CLASS declaration
We need to have a “class” created called ROOM that has width and length defined. This represents a rectangular room. From room we need to define:Bathroom, Livingroom, Bedroom and Kitchen.You also need to have methods that can calculate the area of the room and set the length and width.
Given that we have the following house :
Bedroom1 (L=15,W=10)
Bathroom1 (L=10,W=7)
Kitchen1(L=15, W= 10)
Livingroom1 (L=25,W=20)
Calculate the total area of the home based on adding all room areas together and DISPLAY the result.
|
|--------------------We also know that in a certain area in an area of homes. ALL homes are above 1000 square feet.Could the house above be located in this area in specific?
------------------------You must display your result including the square feet of the house above.
C++
comments
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- Create a UML Diagram of a class named Investment with fields called principal and interest. It also contains methods named value_after that returns the value of the investment after n years. The formula for this is p(1+i)ⁿ, where p is the principal, and i is the interest rate.arrow_forwardA Door Class A computer game usually has many different objects that can be seen and manipulated. One typical object is a door. Whether a player runs through a castle, attacks the forces of an evil empire, or places furniture in a room, a door often comes into play. Implement a Door class as described below as well as a TestDoor class that instantiates three Door objects labeled “Enter,” “Exit,” and “Treasure.” The “Enter” door should be left unlocked and opened. The “Exit” door should be left closed and locked. The “Treasure” door should be left open but locked. A Door class A Door object can • display an inscription, • be either open or closed, and • be either locked or unlocked. Here are some rules about how Door’s work. • Once the writing on a Door is set, it cannot be changed. • You may open a Door if and only if it is unlocked and closed. • You may close a Door if and only if it is open. • You may lock a Door if and only if it is unlocked, and unlock a Door if…arrow_forwardFor this assignment, you will develop the planning necessary for constructing a class that implements a Bag ADT in Java. Your program will store corresponding items for an On-Line Food Delivery Service. Specifically, your program should consider an item's name and price and manage the customer's shopping cart. The following are example values your class will be using for data: Customer Number = 1; item_Name="Can of Soup"; Price = $4.00; After selecting your values for data, what are the required operations that must be used to create the Bag Interface? Your deliverable will consist of the following: Pseudocode for your proposed program Flowchart of the operations of adding items to the shopping cart and removing items from the cart.arrow_forward
- The total cost of a group of items at a grocery store is based on the sum of the individual product prices and the tax (which is 5.75%). Products that are considered “necessities” are not taxed, whereas products that are considered “luxuries” are. The Product class is abstract, and it has a method called getTotalPrice. Your task is to create two subclasses of Product: NecessaryProduct and LuxuryProduct and implement the getTotalPrice method in each of these classes appropriately. Then modify the driver program to instantiate four products (two necessary and two luxury) and store them in the product array, print out each item in the array, and display the total cost of the items. You should not make any changes at all to Product.java, and you should only add to ShoppingTripStartingCode.java. Do not change any code that is already present Example(Cheese and bread are necessities and soda and candy are luxuries)Cheese…arrow_forwardAssume method testQuestion() is a method in the Purchase class. Assume the Purchase class has a constructor that has parameters of name, groupCount, groupPrice, and numberBought. public Purchase testQuestion(Purchase p1, int newX) { newX = 20; this.setName("green beans"); p1.setName("corn"); Purchase p2 = new Purchase("broccoli", 5, 4.50, 10); return p2; } Referring to the above method, list the output that would be printed by Sysyem.out.println() when the following PurchaseDemo2 is executed. public class PurchaseDemo2 { public static void main(String[] args) { Purchase tomsPurchase = new Purchase("squash",4,3.50,6 ); Purchase jillsPurchase = new Purchase("carrot",8,1.99,4 ); Purchase billsPurchase;…arrow_forwardThe class provided represents a item. Information about a item includes the name of the item and the count of items in inventory (inventory count). When ordering items they are ordered in descending order by the inventory count. If items have the same inventory count then they are ordered in ascending alphabetical order by their name (a-z). Here is an example set of items: 7 Camera 5 Bicycle 5 Lego 5 Robot 3 Tricycle The Item class is missing a required method. Write the missing method in the space provided below. public class Item implements Comparable { private String name; private int count; public Item (String nameIn, int count In) { name name In; count countIn; }arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education