Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help building this program in JAVA This program builds on the previous assignment. A typical cylinder is built on the basis of a

I need help building this program in JAVA

This program builds on the previous assignment. A typical cylinder is built on the basis of a circle. In your last assignment you created a class Circle.

Your task for this assignment is to use the idea of Aggregation to build a class called Cylinder. (10 pts)

The private members of the Cylinder should be a Circle object as well as a double variable for the height. (20 pts)

Create appropriate constructors for the Cylinder class including a copy constructor. You may also want to create a copy constructor for the Circle class as well. (20 pts)

Along with the appropriate getters and setters, create methods that determine the area of a cylinder (using methods that the Circle object has already provided), and the volume of a cylinder. (20 pts)

Create a demo class to demonstrate your methods. Create an object of type Cylinder. Call the getters setters and use the constructors. Ask the user the size of the radius and height and print out the Volume of the Cylinder. (30 pts)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions