Waived!

In this lab assignment, you are asked to write java code of given classes in the following class diagram You are given an UML diagram that expresses relationship between three classes. Circle class is the parent class of the Curve and Cylinder classes.

(2 customer reviews)

Original price was: $30.00.Current price is: $20.00.

Download button will appear immediately after successful payment.

Full support will be provided with necessary files installation.

Get impeccable customized solution within 24 hours, hassle-free.

Book your next exam with us and get A+ in entire semester, guaranteed!

View Details
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.
Instant
Download

Description

In this lab assignment, you are asked to write java code of given classes in the following class diagram.

You are given an UML diagram that expresses relationship between three classes. Circle class is the parent class of the Curve and Cylinder classes. Also, you are given Circle.java and testlnheritance.java files. Examine the given UML diagram and code. 

1) Add variable definitions to the Circle class. Be careful about accessibility modifiers given in the UML 

2) Implement the getArea method. The method will initially print the message: name of the class + "getArea method is invoked". Then, it will calculate and return the area of the circle by the formula area =πr2. Note: You can retrieve the name of the class by this.getClass(). getSimpleName(). 

3) Implement Curve and Cylinder classes as given in the UML diagram. 
a. getArea method in the Curve and Cylinder class will initially print the message: name of the class + "getArea method is invoked". 
b. Then, it will calculate the area of the object and return it. 
c. Area formulation for cylinder: A=2πr(h+r) ( h stands for height) 
d. Area formulation for curve: A=(α/360)πr2 ( α stands for angle) 
e. draw method of Curve and Cylinder classes will initially call the parent class' draw method. Note: Your can access the method of the parent class by super.method() 
f. Then, it will print one of the following strings: "This method is overloaded with an double parameter the value is: " + val "This method is overloaded with an int parameter the value is: " + val 

4) Complete the testinheritance class to produce the following output. Add calls to getArea and draw methods and print the calculated areas. 

Note: Do not forget to add variable definitions and implement getters and setters in all classes. 

Expected Output: 

Circle getarea method is invoked 
Circle area value is: 78.5 
Cylinder getarea method is invoked 
Cylinder area value is: 351.68 
Curve getarea method is invoked 
Curve area value is: 2.3549999999999995 
Circle draw method is invoked cylinder draw method is invoked 
Cylinder draw method is invoked 
This method is overloaded with an int parameter the value is: 20 
Curve draw method is invoked 
Curve draw method is invoked 
Curve draw method is invoked 
This method is overloaded with an double parameter the value is: 10.8


2 reviews for In this lab assignment, you are asked to write java code of given classes in the following class diagram You are given an UML diagram that expresses relationship between three classes. Circle class is the parent class of the Curve and Cylinder classes.

  1. Judie Hoffman

    Great quality solution, Done way before time

  2. Jasmyne Nall-Perkins

    Awesome work as usual!!

Only logged in customers who have purchased this product may leave a review.


You may also like…

Patron Details

Additional information

Your Solution

Product
Quantity
Total
Cart Subtotal $0.00
Order Total $0.00

  • Pay with your credit card.