Write a complete Java program based on the UML class diagram given in Figure 1. Your program should be able to produce t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a complete Java program based on the UML class diagram given in Figure 1. Your program should be able to produce t

Post by answerhappygod »

Write A Complete Java Program Based On The Uml Class Diagram Given In Figure 1 Your Program Should Be Able To Produce T 1
Write A Complete Java Program Based On The Uml Class Diagram Given In Figure 1 Your Program Should Be Able To Produce T 1 (92.89 KiB) Viewed 23 times
please provide correct ans it's urgent ...only got 40 minsir
Write a complete Java program based on the UML class diagram given in Figure 1. Your program should be able to produce the output shown in Figure 3. << interface >> Convertible poundToGram = 453.59 USDTOMYR = 4.43 Canned Food << abstract >> Groceries - description: String -price: double + Groceries () + Groceries(String, double) + getDescription(): String + getPrice(): double + calcPriceInMYR(): double + abstract displayInfo(): String -expiredDate: String -type: String Canned Food(String, double, String, String) Fruit -weight: double buy Fruit(String, double, double) A Figure 1: UML class diagram Customer - name: String - totalPrice: double -groceriesList: ArrayList<Groceries>> + Customer(String) + buy (Groceries): void +toString(): String + print(): void + calcitemPurchased(): int Groceries App + static main(String): void -static dispMenu(): void Implement all the classes with the instance variables (attributes) and methods specified in the diagram. The purpose of each method is as the name implies, and some of them are further explained below. Write the program based on the following tasks:
(b) Write an interface named Convertible and declare two final static variables. (1 Mark) (c) Write an abstract superclass named Groceries that implements the Convertible interface. The class provides the default constructor that does nothing and the constructor with arguments that initialize all the member attributes to the values passed as arguments. It also provides the getDescription method, which returns the value of description member variable, as well as the get Price method, which returns the value of price member variable. The calcPriceInMYR method will return the value of the converted price in MYR. (5 Marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply