Calculates the price of carpeting for rectangular rooms.

Assignment Help JAVA Programming
Reference no: EM13941215

The Westfield Carpet Company has asked you to write an application that calculates the price of carpeting for rectangular rooms. To calculate the price, you multiply the area of the floor(width times length) by the price per square foot of carpet. For example, the area of floor that is 12 feet long and 10 feet wide is 120 square feet. To cover that floor with carpet that costs $8 per square foot would cost $960 (12x10x8=960).

First, you should create a class named RoomDimension that has two FeetInches objects as attributes: one for the length of the room and one for the width. The RoomDimension class should have a member function that returns the area of the room as a FeetInches object.

Next, you should create a RoomCarpet class that has a RoomDimension object as an attribute. It should also have an attribute for the cost of the carpet per square foot. The RoomCarpet class should have a member function that returns the total cost of the carpet.

Once you have written these classes, use them in an application that asks the user to enter the dimensions of a room and the price per square foot of the desired carpeting. The application should display the total cost of the carpet.

Reference no: EM13941215

Questions Cloud

Difference between WACCs using market value and book value : ABC Trucking's balance sheet shows a total of noncallable $35 million long-term debt with a coupon rate of 5.10% and a yield to maturity of 5.20%. The CFO thinks the WACC should be based on market value weights, but the president thinks book weights ..
The workplace relations and other amendments : Task In what ways has the Fair Work Act 2009 been framed by its makers to be fairer than its predecessor, the Workplace Relations and Other Amendments (Work Choices) Act 2005.
Strategic nature of the hr function : 1. Human Resources Information Systems have contributed to the increasingly strategic nature of the HR function'. Discuss.
Find internal rate of return of project with an initial cost : Find internal rate of return of a project with an initial cost of $43,000, expected net cash inflows of $9,550 per year for 8 years, and a cost of capital of 9.60%.
Calculates the price of carpeting for rectangular rooms. : Once you have written these classes, use them in an application that asks the user to enter the dimensions of a room and the price per square foot of the desired carpeting. The application should display the total cost of the carpet.
What is the initial cash outlay and free cash flow : You are the head of finance department in XYZ Company. You are considering adding a new machine to your production facility. The new machine’s base price is $10,900.00, and it would cost another $1,970.00 to install it. What is the initial cash outla..
Research corporate governance failure : To demonstrate that you are capable of researching and analysing an instance where a corporation did not comply with corporate governance requirements. Specifically, you will be assessed on your ability to research and analyse the corporate govern..
Benefits of using a computerised accounting system : create and setup a company - record transactions and prepare a number of financial reports; and -
Role of hrm in executing the business strategy at unitel : In your report, you are required to: • Explain the role of HRM in executing the business strategy at Unitel. • Identify key issues relating to the introduction of the new corporate strategy by Unitel senior management.

Reviews

Write a Review

JAVA Programming Questions & Answers

  On any given execution your program

On any given execution your program will produce just one version of the figure. However, you should refer to the class constant throughout your code, so that by simply changing your constant's value and recompiling, your program would produce a f..

  Draw a uml diagram of each of the shapes

Draw a UML diagram of each of the Shapes, Rectangle and Square classes using the code that has been provided. Complete this using the examples that have been provide in the lecture slides.

  Classes using set and get methods

Create a java program that contains two classes using set and get methods. I need the program to return the area and perimeter of a rectangle. I wrote a program and he returned to me saying I used the wrong constructors and didn't create a the sec..

  Write a program in java that simulates a simple line editor

Write a program in Java that simulates a simple line editor which supports the following operations

  What are the equilibrium price and quantity of corn

The table above contains information about the corn market. Use the table to answer the following questions. a.       What are the equilibrium price and quantity of corn? b.       Suppose the prevailing price is $9 per bushel. Is there a shortage o..

  Create a user interface for a library application

Create a user interface for a library application that allows the user (i.e., the Librarian) to enter Book objects.

  Method definition to count and then return the number

Write a nested loop structure that prints out the following number series: 111 112 121 122 211 212 221 222. The innermost loop may have only one print statement and no literal string output except a space (" ").

  Create a java class namedtextprocessorgui

Create a Java class namedTextProcessorGUI. Provide a main() function that creates and displays an instance ofTextProcessorGUI. I recommend you write this class as a subclass ofJFrame.

  Rewrittting codes in java

However, I am told the above code would not be written by an experienced Java programmer because the showMessageDialog method is static within the class. How would a pro would write it?

  Examples of cultural productions from three cultures

Using specific examples of cultural productions from three cultures -Sumerians, Archaic Greeks (800-480 BCE), Classical Greeks (480-323 BCE)- explain how cultural values and ideals are reflected in the creation and style of cultural productions.

  Write a java application that allows the user to read

Write a java application that allows the user to read, validate, store, display, sort and search the account number and balance for N bank customers.

  Write java programming to show number of credits for course

Write the java programming to solve following problem. We are given a student's marks in Calculus 1, CS1, and Physics 1 (each mark being between 0 and 100) also number of credits for each course.

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