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
Select the correct answer. Ruby wants to create a cube puzzle game. For that she has to create a cube. Which drafting tool do yo
Alexxx [7]

Answer:

D. a triangle and a T-Square

Explanation:

A T-Square is the best drawing tool to create squares. You would need a squares to create cubes.

3 0
3 years ago
Please write the following code in Python 3. Also please show all output(s) and share your code.
maksim [4K]

Answer:

sum2 = 0

counter = 0

lst = [65, 78, 21, 33]

while counter < len(lst):

   sum2 = sum2 + lst[counter]

   counter += 1

Explanation:

The counter variable is initialized to control the while loop and access the numbers in <em>lst</em>

While there are numbers in the <em>lst</em>,  loop through <em>lst</em>

Add the numbers in <em>lst</em> to the sum2

Increment <em>counter</em> by 1 after each iteration

6 0
3 years ago
Omg help mr idk what to say ahhh​
kap26 [50]

Explanation:

ответ на фото !!!!!!

7 0
3 years ago
Read 2 more answers
The observations of 124.53, 124.55, 142.51, and 124.52 are obtained when taping the length of a line. What should the observer c
Nesterboy [21]

Answer:

attached below

Explanation:

8 0
3 years ago
A digital filter is given by the following difference equationy[n] = x[n] − x[n − 2] −1/4y[n − 2].(a) Find the transfer function
slega [8]

Answer:

y(z) = x(z) - x(z) {z}^{ - 2}  -  \frac{1}{4} y(z) {z}^{ - 2}  \\ y(z) + \frac{1}{4} y(z) {z}^{ - 2} = x(z) - x(z) {z}^{ - 2} \\ y(z) (1 + \frac{1}{4}{z}^{ - 2}) = x(z)(1 - {z}^{ - 2}) \\  h(z) = \frac{y(z)}{x(z)}  =  \frac{(1 + \frac{1}{4}{z}^{ - 2})}{(1 - {z}^{ - 2})}

The rest is straightforward...

6 0
3 years ago
Other questions:
  • provides steady-state operating data for a solar power plant that operates on a Rankine cycle with Refrigerant 134a as its worki
    12·1 answer
  • A 15-ft beam weighing 570 lb is lowered by means of two cables unwinding from overhead cranes. As the beam approaches the ground
    9·1 answer
  • What do humans breathe
    8·2 answers
  • In an experiment, the local heat transfer over a flat plate were correlated in the form of local Nusselt number as expressed by
    5·1 answer
  • Do all websites use the same coding to create?
    8·1 answer
  • Which statement concerning symbols used on plans is true?
    10·1 answer
  • Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs. 12.00
    13·1 answer
  • Technician a says that diesel engines can produce more power because air in fuel or not mix during the intake stroke. Technician
    9·1 answer
  • Everyone has only one learning style. True or false? hurry pleasle this exp carees class
    11·1 answer
  • Select the correct answer.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!