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
python Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E.
MissTica

Explanation:

First of all get the input from the user, number of rows and number of columns where rows represents seat digit number and column represents the seat letter

rows is initialized to 1 to ensure that row starts at 1 or you can remove it then seat number will start from 0.

The first loop is used for digits starting from 1 to number of rows

The second loop is used for letters starting from 1 to number of columns

since rows and cols are not of the same type that's why we are converting the int type to string type

print(str(rows)+cols) counter will keep updating the columns A, B, C.....

rows= rows + 1 counter will keep updating the rows 1, 2, 3....

Code:

Please refer to the attached image.

Output:

Please enter the number of rows: 2

Please enter the number of columns: 3

1A

1B

1C

2A

2B

2C

3 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
Wave flow of an incompressible fluid into a solid surface follows a sinusoidal pattern. Flow is two-dimensional with the x-axis
Artyom0805 [142]

Answer:

sorry , for my point

Explanation:

4 0
3 years ago
If the specific surface energy for aluminum oxide is 0.90 J/m2 and its modulus of elasticity is (393 GPa), compute the critical
vampirchik [111]

Answer:

critical stress required for the propagation is 27.396615 ×10^{6} N/m²

Explanation:

given data

specific surface energy = 0.90 J/m²

modulus of elasticity E = 393 GPa = 393 ×10^{9} N/m²

internal crack length = 0.6 mm

to find out

critical stress required for the propagation

solution

we will apply here critical stress formula for propagation of internal crack

( σc ) = \sqrt{\frac{2E\gamma s}{\pi a}}    .....................1

here E is modulus of elasticity and γs is specific surface energy and a is half length of crack i.e 0.3 mm  = 0.3 ×10^{-3} m

so now put value in equation 1 we get

( σc ) = \sqrt{\frac{2E\gamma s}{\pi a}}

( σc ) = \sqrt{\frac{2*393*10^9*0.90}{\pi 0.3*10^{-3}}}

( σc ) = 27.396615 ×10^{6} N/m²

so critical stress required for the propagation is 27.396615 ×10^{6} N/m²

6 0
3 years ago
9. How is the Air Delivery temperature controlled during A/C operation?
Rzqust [24]

Answer:

i believe the answer is a but i could be wrong

Explanation:

i hope it helps

6 0
3 years ago
Other questions:
  • In order to avoid slipping in the shop, your footwear should __
    10·2 answers
  • Find the difference between the first and third angle projection type.
    11·1 answer
  • The market for college textbooks is illustrated in the graph below. In the market for textbooks, the current price of a textbook
    11·1 answer
  • Part A - Transmitted power A solid circular rod is used to transmit power from a motor to a machine. The diameter of the rod is
    8·1 answer
  • In highways the far left lane is usually the _____
    11·2 answers
  • Technician A says that 18 gauge AWG wire can carry more current flow that 12 gauge AWG wire. Technician B says that metric wire
    9·1 answer
  • I study to get good grades because my parents want to send me to the college of my choice.” This is an a. Intrinsic motivational
    6·2 answers
  • A water agency stated that waterlines cannot have water flowing faster than 8 ft/s. What is the minimum standard pipe diameter t
    12·1 answer
  • Why is California a good place for engineers to build suspension bridges?
    12·1 answer
  • You are coming to this intersection, and are planning on turningright. There is a vehicle close behind you. You should?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!