Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Rectangle {
- public static void main(String[] strings) {
- final double width = 5.6;
- final double height = 8.5;
- double perimeter = 2*(height + width);
- double area = width * height;
- System.out.printf("Perimeter is 2*(%.1f + %.1f) = %.2f \n", height, width, perimeter);
- System.out.printf("Area is %.1f * %.1f = %.2f \n", height, width, area);
- }
- }
Add Comment
Please, Sign In to add comment