1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Marrrta [24]
3 years ago
8

The ABC Carpet Company has asked you to write an application that calculates the price of carpeting for rectangular rooms. To ca

lculate 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 wideis 120 square feet. To cover that floor with carpet that costs $8per square footwould cost $960. (12x10x8= 960)
Computers and Technology
1 answer:
Annette [7]3 years ago
8 0

Answer:

class RoomDimension

{

double length;

double width;

public RoomDimension(double len, double w)

{

length = len;

width = w;

}

public double getLength()

{

return length;

}

public double getWidth()

{

return width;

}

public double getArea()

{

return length * width;

}

public String toString()

{

String output;

output = "Room dimensions:\nLength: " + length + "\nWidth: " + width + "\nArea: " + getArea();

return output;

}

}

And the code for RoomCarpet.java:

class RoomCarpet //extends RoomDimension

{

RoomDimension size;

double carpetCost;

public RoomCarpet(RoomDimension dim, double cost)

{

size = new RoomDimension(dim.getLength(), dim.getWidth());

carpetCost = cost;

}

public double getTotalCost()

{

return carpetCost;

}

public String toString()

{

String output = size + "\nCarpet cost: $" + carpetCost * size.getArea();

return output;

}

}

You might be interested in
A technician is tasked with installing the Windows OS on a Mac OS computer so that the computer can boot to either the Mac OS or
nata0808 [166]

Answer:

Key chain because it easier

Explanation:

4 0
2 years ago
Which is a credit card balance A. The amount of interest you must pay the credit card company B. The required minimum payment to
yKpoI14uk [10]
The best answer among the following choices would be the fourth option D).
7 0
3 years ago
What is spam? a type of virus that spreads from computer to computer through a network connection a type of virus that targets p
Bas_tet [7]

Answer:

This is a pretty obvious answer.

An unwanted e-mail sent in bulk from people or organizations.

Explanation:

8 0
3 years ago
Generalized goals are more likely to be achieved than specific goals. True or False
pantera1 [17]
False

They are likely to be achieved because they are well defined, clear, and unambiguous.
6 0
3 years ago
Which type of address is the ip address 198.162.12.254/24?
Ilya [14]
Multicast Which of the following address types is shared by multiple hosts, and is used to form groups of computers that should receive the same data stream?

Which type of address is the IP address 198.162.12.254/24?
Unicast
8 0
4 years ago
Other questions:
  • which of the following is involved in ordering an outline. A.grouping B.merging C.organizing D.arranging
    10·1 answer
  • Write an if/else statement that compares the variable age with 65, adds 1 to the variable seniorCitizens if age is greater than
    14·1 answer
  • Which of the following types of memory extends the actual physical memory of a computer by copying blocks of data from the memor
    11·1 answer
  • Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, ma
    13·1 answer
  • Match the careers with the education required for each job
    5·1 answer
  • Who are the best candidates for members of skills USA?
    8·1 answer
  • What is the term given to the controls that let you interact with an operating system?
    11·1 answer
  • How should resumes and cover letters be written to help you obtain a job that meets your
    14·1 answer
  • Can someone write an essay on data storage and describe the different storages I have listed below•
    11·2 answers
  • To set up scenarios,then set up a list, then set up the reference cell. to set up the cells that display the output results from
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!