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
the voltage across a 5mH inductor is 5[1-exp(-0.5t)]V. Calculate the current through the inductor and the energy stored in the i
Serggg [28]

Given Information:

Inductance = L = 5 mH = 0.005 H

Time = t = 2 seconds

Required Information:

Current at t = 2 seconds = i(t) = ?

Energy at t = 2 seconds = W = ?

Answer:

Current at t = 2 seconds = i(t) = 735.75 A

Energy at t = 2 seconds = W = 1353.32 J

Explanation:

The voltage across an inductor is given as

V(t) = 5(1-e^{-0.5t})

The current flowing through the inductor is given by

i(t) = \frac{1}{L} \int_0^t \mathrm{V(t)}\,\mathrm{d}t \,+ i(0)

Where L is the inductance and i(0) is the initial current in the inductor which we will assume to be zero since it is not given.

i(t) = \frac{1}{0.005} \int_0^t \mathrm{5(1-e^{-0.5t}}) \,\mathrm{d}t \,+ 0\\\\i(t) = 200 \int_0^t \mathrm{5(1-e^{-0.5t}}) \,\mathrm{d}t \\\\i(t) = 200 \: [ {5\: (t + \frac{e^{-0.5t}}{0.5})]_0^t \\i(t) = 200\times5\: \: [ { (t + 2e^{-0.5t} + 2 )] \\

i(t) = 1000t +2000e^{-0.5t} -2000\\

So the current at t = 2 seconds is

i(t) = 1000(2) +2000e^{-0.5(2)} -2000\\\\i(t) = 735.75 \: A

The energy stored in the inductor at t = 2 seconds is

W = \frac{1}{2}Li(t)^{2}\\\\W = \frac{1}{2}0.005(735.75)^{2}\\\\W = 1353.32 \:J

4 0
2 years ago
Which of the following refers to software designed to alter system files and utilities on a victim’s system with the intention o
Oksi-84 [34.3K]
The answer is Rootkits.
6 0
3 years ago
It is not a practical proposition to take direct measurements in nanoscale, but we can estimate variations in position and momen
Volgvan

Answer:

Answer is c Heisenberg's uncertainty principle

Explanation:

According to Heisenberg's uncertainty principle there is always an inherent uncertainty in measuring the position and momentum of a particle simultaneously.

Mathematically

\Delta x\times \Delta \overrightarrow{p}\geq \frac{h}{4\pi }

here 'h' is planck's constant

7 0
3 years ago
A triangular plate with a base 5 ft and altitude 3 ft is submerged vertically in water. If the base is in the surface of water,
Scorpion4ik [409]

Answer:

Hydrostatic force = 41168 N

Explanation:

Complete question

A triangular plate with a base 5 ft and altitude 3 ft is submerged vertically in water  so that the top is 4 ft below the surface. If the base is in the surface of water, find the force against onr side of the plate. Express the hydrostatic force against one side of the plate as an integral and evaluate it. (Recall that the weight density of water is 62.5 lb/ft3.)

Let "x" be the side length submerged in water.

Then

w(x)/base = (4+3-x)/altitude

w(x)/5 = (4+3-x)/3

w(x) = 5* (7-x)/3

Hydrostatic force = 62.5 integration of  x * 4 * (10-x)/3 with limits from 4 to 7

HF = integration of 40x - 4x^2/3

HF = 20x^2 - 4x^3/9 with limit 4 to 7

HF = (20*7^2 - 4*7^(3/9))- (20*4^2 - 4*4^(3/9))

HF = 658.69 N *62.5 = 41168 N

4 0
2 years ago
A cold storage room is used to keep the temperature inside the room maintain at low temperature.
lianna [129]

Answer:

The power of the brick wall it may be how the soiled ness of the wall too keep in the cold

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • The difference between ideal voltage source and the ideal current source​
    7·2 answers
  • According to Manor, the example of the subway train in New York City is an example of which type of uniqueness?
    9·1 answer
  • A pump is used to transport water from a reservoir at one elevation to another reservoir at a higher elevation. If the elevation
    5·1 answer
  • A cylindrical specimen of this alloy 12.7 mm in diameter and 250 mm long is stressed in tension and found to elongate 7.6 mm. On
    5·1 answer
  • When removing the balance shaft assembly: Technician A inspects the bearings for unusual wear or damage. Technician B smoothens
    15·1 answer
  • A hollow aluminum sphere, with an electrical heater in the center, is used in tests to determine the thermal conductivity of ins
    6·1 answer
  • Some General Motors flex fuel vehicles do not use a fuel sensor to measure the percentage of ethanol in the fuel. These vehicles
    5·1 answer
  • Certain pieces made by an acoustic lathe are subject to three kinds of defects X,Y,Z. A sample of 100 pieces was inspected with
    6·1 answer
  • Which battery produces more volts per cell, maintenance type or maintenance free ?
    6·1 answer
  • How might a field like philosophy of history help scientists​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!