Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java question. Create a class Shape which performs the following. a. Provide a method asca Circle which takes one parameter radius as double, calculates 03

image text in transcribed
image text in transcribed
image text in transcribed
Java question.
Create a class Shape which performs the following. a. Provide a method asca Circle which takes one parameter radius as double, calculates 03 Marks and returns the area of the circle as double. [Formula: Area=ar'] b. Provide a method circumCircle which takes one parameter radius as double, calculates and returns the circumference of the circle as double. [Formula: 03 Marks Circumference=2xr] c. Provide a method sphersSurfaceArea which takes one parameter radius as double, calculates and returns the surface area of the sphere as double. [Formula: Surface 03 Marks Area=4mr'] d. Provide a method sphere Volume which takes one parameter radius as double, calculates and returns the volume of the sphere as double. [Formula: 03 Marks Volume=4/370 03 Marks All the methods are stats. Use Pland power method from Math class. Create a class Shape Test which performs the following: a. Read the radius from the user until radius is 0. b. Call the methods to display the area, circumference, surface area and volume. Sample Output: Enter radius to stop (0 :: 3 05 Marks Area of the circle for the 3.00 radius = 28.27 Circumference of the circle for the 3.00 radius = 18.85 Surface area of the sphere for the 3.00 radius = 113.10 Volume of the sphere for the 3.00 radius = 113.10 Enter radius to stop (0) 6 Area of the circle for the 6.00 radius = 113.10 Circumference of the circle for the 6.00 radius = 37.70 Surface area of the sphere for the 6.00 radius = 452.39 Volume of the sphere for the 6.00 radius = 904.78 03 Marks Enter radius to stop (0) :: 4 Area of the circle for the 4.00 radius = 50.27 Circumference of the circle for the 4.00 radius = 25.13 Surface area of the sphere for the 4.00 radius = 201.06 Volume of the sphere for the 4.00 radius = 268.08 Enter radius to stop (0) Thank you for using.!!! 2. Write JAVA program as per class diagram and description given below: Employee -id: int -name: String - salary: double -experience: int +Employee(id1: int, namel: String, salaryl: double, experience: int) +getIDO: int +getName(): Stirng +getSalary(): double +getExperience(): int +calSalaryo: double 04 Marks 05 Marks a. Define the class and instance variable as per the class diagram b. Define the constructor as per the class diagram Define the getters as per the class diagram d. For the method calSalary:0 you have to return the calculated salary based on the 04 Marks C

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

x-3+1, x23 Let f(x) = -*+3, * Answered: 1 week ago

Answered: 1 week ago

Question

=+ Are ballots compulsory?

Answered: 1 week ago