Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Info module in folio and available to d Part II: Design a class named Cylinder to represent cylinders. The class contains: Two double data fields

image text in transcribed
Info module in folio and available to d Part II: Design a class named Cylinder to represent cylinders. The class contains: Two double data fields named radius and length that specify the radius and length of a cylinder. The default values are 1.0 for radius and length. no-arg constructor that creates a default cylinder. A constructor that creates a cylinder with the specified radius and length. A method named getArea() that returns the base area of the cylinder. A method named getVolume0 that returns the volume of the cylinder. Requirements 1. Draw the UML diagram for the class. Implement this class. 2. Write a test program that should do the following tasks: create the first cylinder object using the no-arg constructor; create a second cylinder using the constructor with arguments to set radius to 2.5 and length to 12.3; create a third cylinder using the no-arg constructor change the third cylinder's radius to 5.0 and length to 6.5. print out the radius and length of the first cylinder; print out the area of the second cylinder; print out the volume of the third cylinder. > Grading: This part is worth 100 points. If your program has compilation or run time errors, you will receive 0 point. Out of 100 maximum points, the UML will count for 30 points, the program will count for 70 points. For the programming part

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions