Page 1 of 1

Object Oriented Programming (OOP) Assignment: 3 40 Minutes Name: Group: ID: Date: Problem 1: Description [5 Marks] Use t

Posted: Tue May 24, 2022 8:26 am
by answerhappygod
Object Oriented Programming Oop Assignment 3 40 Minutes Name Group Id Date Problem 1 Description 5 Marks Use T 1
Object Oriented Programming Oop Assignment 3 40 Minutes Name Group Id Date Problem 1 Description 5 Marks Use T 1 (67.92 KiB) Viewed 12 times
Object Oriented Programming (OOP) Assignment: 3 40 Minutes Name: Group: ID: Date: Problem 1: Description [5 Marks] Use the following UML Diagram to write a Java program that consists of multiple classes: Electronics + Price: int + Maker: String <<Interface>> Kitchenware + electronics () + getEnergySource (): String + cockMethod () Oven + energySource: String + oven() + getEnergySource (): String + cockMethod() Tv + tv () + Remote Control ()

1- Electronics Class: root/parent/super class a- Electronics method: receives arguments to initialize price and maker. b- Maker: means company or country. 2- Tv Class: extends Electronics class a- Electronics method: receives arguments to initialize price and maker. b- Remote Control method: prints out the following sentence: "The TV made by (maker) which costs (price) is operated by remote control only." 3- Kitchenware Interface: Create the interface 4- Oven Calss: extends Electronics class and implement Kitchen Ware interface a- Add String variable (cookWay) as instance variable to the class. (Cook way means: uses heat or air or oil to make the food cooked) b- energySource: means electricity or gas. c- Oven method: receives arguments to initialize energy Source, cookWay, price and maker. d- getEnergy Source method: return energySource as String. c- cookMethod method: prints out the following sentence: "The Oven made by (maker) which costs (price) is using (energy Source) to cock food using (cookWay)." 5- On the Main class, create Tv object and use it to call remote Control method. Create Oven object and use it to call getEnergySourcs and cookMethod. Hint: Use your own values. (For example: A Tv made bu LG that costs 2000s.r.) (For example: An Oven that made by Gelmgas that costs 3500s.r. and use electricity as energy source to cook using heat)