/home/cdesrivi/NetBeansProjects/CS1/src/shapes/TheRoom.java |
1
2
3
4
5
6 package shapes;
7
8 import java.util.Scanner;
9 import painter.SPainter;
10
11
12
13 @author
14
15 public class TheRoom {
16
17
18 @param args
19
20 public static void main(String[] args) {
21 double wallHeight = 9;
22 double wallWidth = 14;
23 SRectangle wall = new SRectangle(wallHeight, wallWidth);
24 double floorLength = 21;
25 double floorWidth = 14;
26 SRectangle floor = new SRectangle(floorLength, floorWidth);
27 double ceilingLength = 21;
28 double ceilingWidth = 14;
29 SRectangle ceiling = new SRectangle(ceilingLength, ceilingWidth);
30 SPainter painter = new SPainter("RectRoom", 600, 600);
31 painter.draw(wall);
32 painter.draw(ceiling);
33 painter.draw(floor);
34 double face = (ceiling.area() - wall.area());
35 double key = face / 4;
36 double distance = key;
37 System.out.println("Distance between corners" +distance);
38 }
39
40 }
41