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
Write the output expression for a NOR gate with inputs , , and .​
mezya [45]

Answer:

Logic NOR Gate Equivalent

The Boolean expression for a logic NOR gate is denoted by a plus sign, ( + ) with a line or Overline, ( ‾‾ ) over the expression to signify the NOT or logical negation of the NOR gate giving us the Boolean expression of: A+B = Q.

4 0
3 years ago
Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, prin
kirill [66]

Answer:

// The method is defined with a void return type

// It takes a parameter of integer called numCycles

// It is declared static so that it can be called from a static method

public static void printShampooInstructions(int numCycles){

// if numCycles is less than 1, it display "Too few"

   if (numCycles < 1){

       System.out.println("Too few.");

   }

// else if numCycles is less than 1, it display "Too many"

    else if (numCycles > 4){

       System.out.println("Too many.");

   }

// else it uses for loop to print the number of times to display

// Lather and rinse

  else {

       for(int i = 1; i <= numCycles; i++){

           System.out.println(i + ": Lather and rinse.");

       }

       System.out.println("Done");

       

   }

}

Explanation:

The code snippet is written in Java. The method is declared static so that it can be called from another static method. It has a return type of void. It takes an integer as parameter.

It display "Too few" if the passed integer is less than 1. Or it display "Too much" if the passed integer is more than 4. Else it uses for loop to display "Lather and rinse" based on the passed integer.

8 0
3 years ago
What does this middle button on the middle of my Chevrolet equinox steering wheel mean?
almond37 [142]

Answer:

Depending on how new your vehicle is, to me it looks like some sort of turn on button for forward collision safety feature, but i'm not an expert with this particular vehicle. If you want a better answer, I strongly suggest looking at the owner's manual under which should be located in the front dash compartment on the passengers side. Once you have the manual, look in the appendix until you find controls (or something similar) then go to that page and read about your vehicles control buttons. Your answer should be in the manual.

Something that all automobile owners should do right after purchasing a new vehicle, is reading the owners manual. As boring as it may seem, reading the owner's manual will help you get used to your new car quicker and give you instructions on how to take care of your car so that it lasts.

Have a great day, and I wish you safe traveling for now and forever! :)

 

7 0
3 years ago
Read 2 more answers
............ ..........<br>​
sukhopar [10]

Answer:

...................

Explanation:

6 0
3 years ago
The Fisher effect says that _______ . Group of answer choices the nominal interest rate adjusts one for one with the inflation r
Greeley [361]

Answer:

what wrong subject

Explanation:

7 0
3 years ago
Other questions:
  • Which conditions are required for nuclear fusion to begin
    8·1 answer
  • With reference to the NSPE Code of Ethics, which one of the following statements is true regarding the ethical obligations of th
    15·1 answer
  • 12. Dies are turned using a special tool called a/an
    10·1 answer
  • Which of these is least likely a step in replacing a failed compressor?
    12·2 answers
  • The information on a can of pop indicates that the can contains 360 mL. The mass of a full can of pop is 0.369 kg, while an empt
    14·1 answer
  • I need help to convert 23.5 million nanometers to millimeters
    15·2 answers
  • How many buttons in an airbus a380 cockpit
    9·2 answers
  • If my current directory is ‘AR’ write the path for my current directory
    5·1 answer
  • What the minimum wire size for a general residential application on a 20 A circuit
    7·1 answer
  • A) Your friend is faced with a situation i n whi ch t here is a difficulty in
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!