1- Electronics Class: root/parent/super class a- Electronics method: receives arguments to initialize price and maker. b
Posted: Thu May 26, 2022 10:04 am
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- RemoteControl 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 KitchenWare
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 energySource,
cookWay, price and maker.
d- getEnergySource method: return energySource as String.
c- cookMethod method: prints out the following sentence: "The Oven
made by (maker) which costs (price) is using (energySource) to cock
food using (cookWay).”
5- On the Main class, create Tv object and use it to call
remoteControl 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)
Use the following UML Diagram to write a Java program that consists of multiple classes: 4 Electronics + Price: int + Maker: String <<Interface>> + electronics () KitchenWare +getEnergySource (): String + cockMethod () Oven + energySource: String + oven() getEnergySource (): String + cockMethod() Tv + tv () + RemoteControl ()
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- RemoteControl 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 KitchenWare
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 energySource,
cookWay, price and maker.
d- getEnergySource method: return energySource as String.
c- cookMethod method: prints out the following sentence: "The Oven
made by (maker) which costs (price) is using (energySource) to cock
food using (cookWay).”
5- On the Main class, create Tv object and use it to call
remoteControl 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)
Use the following UML Diagram to write a Java program that consists of multiple classes: 4 Electronics + Price: int + Maker: String <<Interface>> + electronics () KitchenWare +getEnergySource (): String + cockMethod () Oven + energySource: String + oven() getEnergySource (): String + cockMethod() Tv + tv () + RemoteControl ()