Change the cpp program in java

Assignment Help JAVA Programming
Reference no: EM13968912

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

Reference no: EM13968912

Questions Cloud

What some specific ways in which zappos employees empowered : Zappos has made it a priority to empower its employees and enable them to make more decisions. What are some specific ways in which Zappos employees are empowered?
What should susan do to investigate other green market : What should Susan do to investigate other green market opportunities for the hotel? Who do you think Susan should involve in the group of staff to pursue the green program? Why?
Discuss why other structures are not appropriate : Explain why the new mission statement and vision statement are appropriate for Cyber Software, Inc.; Discuss other aspects of the planning phase that impacts Cyber Software, Inc.;
Write an e-mail or a meeting request : You have recently been named the new vice president for operations of Wisconsin Frozen Delights, a regional ice cream manufacturing firm located just outside a large metropolitan area in Wisconsin. Establish the agenda for the meeting. Write an e-m..
Change the cpp program in java : 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();
Determining the probability of winning : It is assumed that the game terminates the ?rst time the player wins or loses. What is the probability of winning?
Develop a java application to calculate the monthly paycheck : Develop a Java application to calculate the monthly paychecks for a number of different types of employees. The employee types are created in a subclass array based on parent base class Employee. Does this ring a bell?
Compare circuit and packet-switched networks. : Provide examples of what currently available systems can be enhanced and where additional opportunities exist.
How a lot of employees cheat a little at work : How a Lot of Employees Cheat a Little at Work. Take your inspiration from Dan Ariely's Ted Talk, "Our Buggy Moral Code" and concepts from Chapters 1-4 to create a Slideshare about unethical workplace behavior. You may focus on one or several uneth..

Reviews

Write a Review

JAVA Programming Questions & Answers

  What is a generic subprogram in java

How do you describe as a type in C++ a pointer to a function that takes two ints as arguments and returns a double. What is a generic subprogram in Java. What are its advantages

  Describe which base class members may not be inherited

Without considering the access attributes, list and describe which base class members may not be inherited by a derived class and provide a rationale for why this is.

  Create a program using a gui interface

In your lab5 folder, compile the file that is a starting point for this assignment. The listing and image of this Java class is on the bottom of this lab description. You can create the programs by cutting and pasting.

  Picky publishing house publishes stories

Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. In..

  Coin change program

coin change program. Make change using fewest number of coins. I'm attempting dynamic programming and i may be misunderstanding the algorithm

  Displays the stored array values on the screen

Displays the stored array values on the screen using WriteInt - Prompts the user for integer input a dozen times

  Write a program to simulate the behavior of the philosophers

Write a program to simulate the behavior of the philosophers, where each philosopher is a thread and the chopsticks are shared objects.

  Write program in java-calculate and display mortgage payment

Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage.

  Implement a method that compares two rectangles

Implement the compare method of the class RectangleComparator. The method compares two rectangles.

  What is the purpose of public , protected keywords in java

What is the purpose of public , protected keywords in java?

  Uml exercise

UML Exercise: Automated Teller Machine (ATM),   1. To allow authorized card holders to make transactions,   Brief Summary of Requirements:

  What are operator overloading rules?

What are operator overloading rules?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd