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 value of Rth is *
Vladimir79 [104]
Johnjjjjjjhhhhhhhhjjjjjjjjjjj
4 0
2 years ago
A world class runner can run long distances at a pace of 15 km/hour. That runner expends 800 kilocalories of energy per hour. a)
maks197457 [2]

Answer: a) 1.05kW b) 3.78MJ c) 5.3 bars

Explanation :

A)

Conversions give 900 kcal as 900000 x 4.2 J/cal {4.2 J/cal is the standard factor}

= 3780kJ

And 1 hour = 3600s

Therefore, Power in watts = 3780/3600 = 1.05kW = 1050W

B)

At 15km/hour a 15km run takes 1 hour.

1 hour is 3600s and the runner burns 1050 joule per second.

Energy used in 1 hour = 3600 x 1050 J/s

= 3780000 J or 3.78MJ

C)

1 mile = 1.61km so 13.1 mile is 13.1 x 1.61 = 21.1km

15km needs 3.78 MJ of energy therefore 21.1km needs 3.78 x 21.1/15 = 5.32MJ =5320 kJ

Finally,

1 Milky Way = 240000 calories = 4.2 x 240000 J = 1008000J or 1008kJ

This means that the runner needs 5320/1008 = 5.3 bars

7 0
3 years ago
Use phasor techniques to determine the impedance seen by the source given that R = 4 Ω, C = 12 μF, L = 6 mH and ω = 2000 rad/sec
Zielflug [23.3K]

Answer:

Z = 29.938Ω ∠22.04°

I = 2.494A

Explanation:

Impedance Z is defined as the total opposition to the flow of current in an AC circuit. In an R-L-C AC circuit, Impedance is expressed as shown:

Z² = R²+(Xl-Xc)²

Z = √R²+(Xl-Xc)²

R is the resistance = 4Ω

Xl is the inductive reactance = ωL

Xc is the capacitive reactance =

1/ωc

Given C = 12 μF, L = 6 mH and ω = 2000 rad/sec

Xl = 2000×6×10^-3

Xl = 12Ω

Xc = 1/2000×12×10^-6

Xc = 1/24000×10^-6

Xc = 1/0.024

Xc = 41.67Ω

Z = √4²+(12-41.67)²

Z = √16+880.31

Z = √896.31

Z = 29.938Ω (to 3dp)

θ = tan^-1(Xl-Xc)/R

θ = tan^-1(12-41.67)/12

θ = tan^-1(-29.67)/12

θ = tan^-1 -2.47

θ = -67.96°

θ = 90-67.96

θ = 22.04° (to 2dp)

To determine the current, we will use the relationship

V = IZ

I =V/Z

Given V = 12V

I = 29.93/12

I = 2.494A (3dp)

7 0
3 years ago
• ¿Qué les reclamó Dios al pueblo?<br> • ¿Qué consecuencias hubo?
HACTEHA [7]

a quien alos israelitas

8 0
3 years ago
Jylan enjoys being in and around water. Based on his interests, which of the following careers might be enjoyable for him? dairy
Tasya [4]

Answer: the answer is a marine biologist

Explanation: the answer is marine biologist because Jylan likes to be in and out the water which means he would be perfect as marine biologist.

6 0
2 years ago
Other questions:
  • A welding rod with κ = 30 (Btu/hr)/(ft ⋅ °F) is 20 cm long and has a diameter of 4 mm. The two ends of the rod are held at 500 °
    5·1 answer
  • Say you have a random, unordered list containing 4096 four-digit numbers. Describe the most efficient way to: sort the list and
    8·1 answer
  • When removing the balance shaft assembly: Technician A inspects the bearings for unusual wear or damage. Technician B smoothens
    15·1 answer
  • Can some one help me with this plumbing question. Even just a guess.<br> Plz no shady links
    11·2 answers
  • 5. The pin support at A allows _______. Select the one that applies. (a) displacement in the x direction (b) rotation about its
    15·1 answer
  • What learning is required to become a mechanical engineer?
    14·1 answer
  • Which type of engineers were the designers of the Great Pyramids of Egypt and the Great Wall of China?
    9·2 answers
  • A fusible link should be how many wire sizes smaller than the actual circuit wire?
    8·1 answer
  • Planetary gears require the armature to be offset via a gear housing that holds the starter drive.
    12·2 answers
  • Explain how smart materials can be used by manufacturers to improve health and safety for children's products and goods.​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!