/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package houseroom; import java.util.Scanner; public class HouseRoom { public class Room { double l; double w; double roomSide; } public static void main(String[] args) { Scanner sc = new Scanner (System.in); // Scanner scc = new Scanner (System.in); System.out.println("Please enter the length of the First room"); Room Room1 = new Room(); Room Room2 = new Room(); Room1.l = sc.nextDouble(); System.out.println("Please enter the width of the First room"); Room1.w = sc.nextDouble(); Room1.roomSide= Room1.l * Room1.w; System.out.println("Please enter the length of the Second room"); Room1.roomSide= Room1.l * Room1.w; Room2.l = sc.nextDouble(); System.out.println("Please enter the width of the second room"); Room2.w = sc.nextDouble(); Room2.roomSide= Room2.l * Room2.w; if(Room1.roomSide > Room2.roomSide) { System.out.println("room one is the parent Room; Room size of "+ Room1.roomSide + " Room 2 is the children room ; Room Side " + Room2.roomSide); } else if(Room1.roomSide < Room2.roomSide) { System.out.println("room 2 is the parent Room size of "+ Room2.roomSide + " Room 1 is the children room ; Room Side " + Room1.roomSide); } else System.out.println("Room are the same size " + "pick which ever room you like"); } }