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
You will start by doing a bit of research on viewfinders and LCD displays on digital cameras. After you feel that you have an un
Lemur [1.5K]

Answer:

SOMEBODY ANSWER IT

Explanation:

JESUS C

3 0
3 years ago
How can website illustrate cooperations and kidness?
Brilliant_brown [7]
It can illustrate cooperation's and kindness by allowing many different people and strangers to post their opinions and thoughts as long as they are being positive about it! Hope i helped
8 0
3 years ago
Which class of fire extinguisher is appropriate for a fire involving electrical/energized electrical equipment?
krok68 [10]
The answer would be a C class fire extinguisher. 
6 0
3 years ago
Read 2 more answers
1. Before operating any power tool, you need to
Anna007 [38]

Answer:

where glasses gloves turn on the power tool

Explanation:

7 0
3 years ago
Consider the following statements: Statement A: In Duplex transmission, either node can transmit while the other node can receiv
sergij07 [2.7K]

Answer:

<u>d. Statement A is true and Statement B is false</u>

Explanation:

Indeed, when using duplex transmission either node can transmit while the other node can receive data from the network. Also, in half-duplex transmission, both the nodes can transmit as well as receive data.

However, in half-duplex transmission, the nodes <em>cannot </em>transmit and receive data at the same time. Hence, this makes Statement B false, while Statement A is true.

4 0
3 years ago
Other questions:
  • What is one way to process your thoughts about the information you are reading?
    14·2 answers
  • Which part of the faucet is the aerator?
    13·1 answer
  • Cloud resources are​ ________ because many different organizations use the same physical hardware.
    12·1 answer
  • technology might not possess emotional intelligence but it can certainly influence ours. how have technological changes affected
    7·1 answer
  • What are attribute grammars used for?
    8·1 answer
  • Adrian wants to run a digital movie clip that his friend shared with him through email. His system has 2 GB of RAM and 20 GB of
    15·1 answer
  • Random Access Memory is tempory computer memory that stores works in progress
    7·1 answer
  • Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the cou
    8·1 answer
  • Draw
    7·1 answer
  • An opening inside the system unit in which you can install additional equipment can be known as
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!