Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please i need the solution within 1 hour with java language Given the following UML diagram: Part 1: Implement the following classes. Check the notes

Please i need the solution within 1 hour with java language

image text in transcribed

image text in transcribed

Given the following UML diagram: Part 1: Implement the following classes. Check the notes below before you start: Device - code: int - price: double - brand : String + device ----All Parameters----) + setters/getters + toString(): String Invoice - client: String - items: Device[ - nbofitems: int + Invoice (client: String) + getClient (): String + addNewDevice(d: Device): void + countTVs(minSize : int) : int + findPC(ram :int): boolean + calculateTotalPrice():double TV - size: int PC + TV (----All Parameters----) - capacity: int + setter/getter - ram: int + toString(): String 1. + PC(----All Parametebe-Device class: (10pts) a. + setter/getter The ToString method should + toString(): String return a String similar to : Code:111, Brand: Samsung, Price: 1900$ 2. The TV class: (10pts) a. The ToString method should return a String similar to : TV: 42 inch, Code:111, Brand: Samsung, Price: 1900$ 3. The PC class: (10pts) a. The ToString method should return a String similar to : PC: Capacity: 256 GB, Ram: 8GB, Code:111, Brand: Samsung, Price: 1900$ 4. The Invoice class: (50pts) a. The items array can have at most 10 elements. b. The client field should include a String (the name of the client) c. The nbofltems should register the real number of devices (how many elements has been added to the array). d. The Invoice (client: String) constructor create an object with the given client name, Item array size 10 and nbofitems equal to zero e. The addNewDevice(d: Device) method will add a new device object to the array item if this array is not full. f. countTVs(minSize : int) returns how many TV in the array have a size greater than or equal the given size g. findPc(Ram :int) returns true if it finds a PC object with the given specification in the array "Item". False otherwise. h. calculate TotalPrice() returns the sum of prices of all items in the array Part 2: Implement a driver class (main class) as follows: (20pts) 1. Create an Invoice object with client name read from the user. 2. Add to the Invoice object 2 TV objects and 1PC of your choice. 3. Add to the invoice object one TV of type "Samsung" size 42 and price 1500 and code 111. 4. Display the number of TVs with minimum size 30. 5. Display the total price of the invoice. 6. Check and display if there is a PC item Ram equal to 8

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions

Question

What is a businesss cost structure?

Answered: 1 week ago

Question

1. Explain why evaluation is important.

Answered: 1 week ago