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
mafiozo [28]
3 years ago
8

Implement a program that manages shapes. Implement a class named Shape with a method area() which returns the double value 0.0.

Implement three derived classes named Rectangle, Square, and Circle. Declare necessary properties in each including getter and setter function and a constructor that sets the values of these properties. Override the area() function in each by calculating the area using the defined properties in that class.Using Java to write a program that repeatedly shows the user a menu to create one of the three main shapes or to print the shapes created so far. If the user selects to create a new shape, the program prompts the user to enter the values for the size of the selected shape. The shape is then stored in an array. If the user selects to print the current shapes, print the name and the total area of each shape to the console.Hint: You may limit the size of the array to 10.
Engineering
1 answer:
djverab [1.8K]3 years ago
3 0

Answer:

Explanation:

The following code was written in Java. It creates classes for each one of the shapes requested and includes all of their variables and the area method, as well as a toString method. Then in the main method, the menu is created which allows the user to enter the shape that they want and if they decide to exit it will print out every shape within the shapes array. Due to technical reasons I have added the code as a txt file below and in the picture you can see the output.

Download txt
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
19e97f0877c0f4554bca1f4a163eadac.jpg
You might be interested in
A 860 kΩ resistor has 34 μA of current. What is the supply voltage for this electric circuit?
Juliette [100K]

Explanation:

first changing kilo ohm to ohm

860000 = 860 kΩ

and change 34 micro ampare to ampare

34 μA=3.4×10^-5

recalling the equation V=I*R

V= 3.4×10^-5×860000

v=29.24

8 0
3 years ago
Read 2 more answers
This is a new technology meant to reduce vehicle roll-overs A. Lane-departure warning B. Anti-lock brakes C. Inspection reports
Naily [24]

Answer:

(b) Anti-lock brakes

Explanation:

The short form of Anti-lock Braking System commonly known as ABS. Its working is based on the fact that the user will be in safe condition when he apply sudden brakes. It usually happens when a in vehicle moving with high speeds on highways encounter anything before them, they hit brakes suddenly which may lead to the tires loosing traction and contact with the roads and rolling over due to inertia as a result of the high speeds. These conditions result in very serious mishaps. Anti-lock system  aims to reduce the mishaps and losses which arise solely due to the locking of tires when brakes are applied. Anti-lock system significantly reduces speed and maintains a safer environment for the user and the vehicle.

5 0
4 years ago
Use the map to answer the question.
djverab [1.8K]

Answer:

Captain falcon

Explanation:

7 0
2 years ago
Please help is due tonight
Kipish [7]

Answer:

tHE answer is b

Explanation:

7 0
3 years ago
Read 2 more answers
To provide some perspective on the dimensions of atomic defects, consider a metal specimen that has a dislocation density of 105
GenaCL600 [577]

Answer:

62.14\ \text{miles}

6213727.37\ \text{miles}

Explanation:

The distance of the chain would be the product of the dislocation density and the volume of the metal.

Dislocation density = 10^5\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^5\times 1000=10^8\ \text{mm}\\ =10^5\ \text{m}

1\ \text{mile}=1609.34\ \text{m}

\dfrac{10^5}{1609.34}=62.14\ \text{miles}

The chain would extend 62.14\ \text{miles}

Dislocation density = 10^{10}\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^{10}\times 1000=10^{13}\ \text{mm}\\ =10^{10}\ \text{m}

\dfrac{10^{10}}{1609.34}=6213727.37\ \text{miles}

The chain would extend 6213727.37\ \text{miles}

3 0
3 years ago
Other questions:
  • In a study comparing banks in Germany and Great Britain, a sample of 145 matched pairs of banks was formed. Each pair contained
    12·1 answer
  • Work-producing devices that operate on reversible processes deliver the most work, and work-consuming devices that operate on re
    6·1 answer
  • In Victorious, when everyone was trapped in the RV, who wasn’t? And what were they doing??
    10·1 answer
  • 3. Which of the following is not a common impact
    7·1 answer
  • A steam power plant operating on a simple ideal Rankine cycle maintains the boiler at 6000 kPa, the turbine inlet at 600 °C, and
    11·1 answer
  • An undeformed specimen of some alloy has an average grain diameter of 0.050 mm. You are asked to reduce its average grain diamet
    11·1 answer
  • Automobile engines normally have
    8·1 answer
  • What is the output of the following program fragment. Choose appropriate data-types of variables to match output.
    10·1 answer
  • All people<br><br><br>id 5603642259 pd 123456<br>on z o o m​
    15·1 answer
  • The three construction crafts that require a MINIMUM of a 4-year college degree are
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!