Search

Solution Cart

Remove item Thumbnail image Product Price Quantity Subtotal
× 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 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. $20.00
$20.00
× Description: For this assignment, we are going to be organizing our variables into arrays! To the user it will appear that nothing has changed - but on the back end, we are making the code more efficient. You will also need to create a flowchart and an array diagram like the one pictured at the end of this document. Requirements: Using the guidelines below, implement the following arrays into your program. Remember to use global variables for array size rather than hard coding their size. 1. Create the following arrays:* a. productInventory[] – should store the quantities of products you currently have in-stock. This array should be updated whenever a product is sold. b. productPrices[] – this array stores the prices for your products c. productWeights[] – this array stores the weights for your products. d. productNames[] – this array holds the names of your products. *NOTE: These arrays should be parallel to each other for consistency. For example, index 0 is always in reference to product1 no matter which array is being referenced. 2. Once your arrays are created, update all references to product prices, inventory, weight, or name to be populated from the array (this includes calculations). 3. You should always be processing your arrays with loops rather than directly referencing an index. 4. Create a menu for the user to do the following: a. Display the contents of the arrays b. Calculate the total value of the inventory c. Look up the price of an item (user chooses the item) d. Identify the most expensive item in your inventory 5. Each of the above menu items should correspond with their own function. 6. Output must be labelled and easy to read as shown in the sample output below. 7. Program must be documented with the following: a. // Name b. // Date c. // Program Name d. // Description Implement the following arrays into your program | Unit 6 $75.00
$75.00

Cart totals

Subtotal $95.00
Total $95.00

Free Worldwide shipping

On all orders above $50

Easy 30 days returns

30 days money back guarantee

International Warranty

Offered in the country of usage

100% Secure Checkout

PayPal / MasterCard / Visa