The code above is C++ version. In java, you must make the variables private

Thehonest
 (Not rated)
 (Not rated)
Chat

class Room
{

private:
double L;
double W;
public:
//functions go here.
}
class House
{
private:
Room room1;
Room room2;
public:
//functions go here
}

The code above is C++ version. In java, you must make the variables private. Dont forget to use the "new" command. Basic Example: House h = new House();
*Make sure each class is in its own file with the correct functions and data types*
The program will basically ask the user to input a L and W for a room, then ask for L and W for the other room. It will then calculate which of the two rooms is bigger. It should assign the bigger room to the parents and smaller room to children. State: "parents get room #_ of size __", "children get room #_ of size __".

Make sure to actually use the class objects for this program

 

    • 10 years ago
    A+ Work
    NOT RATED

    Purchase the answer to view it

    • rooms.zip