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
Question 11 of 20
asambeis [7]

Answer: A.) To convince your manager to use a new meeting organization tool

Explanation:

4 0
3 years ago
What kind of storage is an internet service that provides storage to computer or mobile users?
Free_Kalibri [48]

Cloud is a kind of storage, which is an internet service that provides storage to computer or mobile users. This information technology enables ubiquitous access to shared pools of configurable system resources.

Time-critical data and images can be immediately viewed while away from a main office or location.

4 0
3 years ago
Are new MacBooks have shiny logo ?
tekilochka [14]
Unfortunately they dont.
6 0
3 years ago
4. Which of the following is a face-to-face meeting between the hiring party and the applicant?
Mnenie [13.5K]

Answer:

A

Explanation:

because my mom has done this

8 0
3 years ago
Read 2 more answers
What Is database as used in computer science​
Natalija [7]

Answer:

A database is an organized collection of structured information, or data, typically stored electronically in a computer system.

8 0
3 years ago
Other questions:
  • Public class SomeClass { private String aName; private int aNumber; private boolean amAwesome; public SomeClass(String name, int
    10·1 answer
  • When you add an rss feed to hootsuite publisher, posts from blogs and websites you designate will be?
    5·1 answer
  • What are the disadvantages of having too many featuresin a language?
    7·1 answer
  • Which is true about POP3 and IMAP for incoming email?
    10·1 answer
  • A hacker uses a valid IP address of an internal host, and then from an external system, the hacker attempts to establish a commu
    11·1 answer
  • You have spent $4,000 on liquor for your bar. Your bar sales have been $24,000. What is your cost of sales for liquor, expressed
    5·1 answer
  • It is important organic mineral that is found in the soil as ash​
    8·2 answers
  • Vẽ sơ đồ lắp đặt gồm 2 cầu chì, 1 ổ điện, 2 cực điều khiển 2 đèn mắc song song
    9·1 answer
  • Briefly define each components of information systems (hardware, software, data, networking, people and procedure). While you ar
    6·1 answer
  • What are the functions of information technology?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!