You are on page 1of 1

class Room { int length,breath,height; void setData(int l,int b,int h) { length =l; breadth =b; height =h; }} class

RoomDemo { public static void main(String args[]); { int flrArea,fourWallsArea; Room room1=new room(); room1.setData(15,12,10); fourWallsArea=(2*room1.height)*(room1.length+room1.breadth); flrArea=room1.length+room1.breadth; System.out.println(Length-15,Breadth-12,height-10"); System.out.println("-FourWalls Area="+fourWallsArea); System.out.println("-FLoorArea="+flrArea); } }

You might also like