-
-
Save uncoded-ro/4bb467cf5777889645982ce1a7da39f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ro.virtualcampus.app; | |
import ro.virtualcampus.obiectgrafic.Cerc; | |
import ro.virtualcampus.obiectgrafic.Dreptunghi; | |
public class ObiecteGrafice { | |
public static void main(String args[]) { | |
Cerc cerc = new Cerc(2.3, 3.4, 1.5); | |
Dreptunghi dreptunghi = new Dreptunghi(5.2, 1.8, 3.4, 4.8); | |
System.out.println(cerc); | |
System.out.println(dreptunghi); | |
System.out.printf("Aria cerc: %.2f %n", cerc.aria()); | |
System.out.printf("Perimetru cerc: %.2f %n", cerc.perimetrul()); | |
System.out.printf("Aria dreptunghi: %.2f %n", dreptunghi.aria()); | |
System.out.printf("Perimetru dreptunghi: %.2f %n", dreptunghi.perimetrul()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment