PowerPoint Presentation
Assignment 2 Discussion (1)
Due: Thursday 10/15, Points: 30
Oct. 7, 2020
Poly
morphism
Class
Inheritance
Constructo
Ove
iding
Encap
sulation
Abstract
You now are ready to develop real-world Apps.
We have studied
Real-World App
You are the CEO of Burger211 Inc.
About Burger211 Company
Burger211 manages 1000+ shops in different countries.
Burger211 sells 3 burgers: inheritance Burger, ove
iding Burger and polymorphism Burger.
All 3 burgers have a name, price in US$ and toppings. These values were decided by the HQ in advance.
Each country displays their own style of menu because of different language, price, cu
ency and culture.
All the Buger211 shops in the same country display the same format of menu at their shops.
Menu contains the shop name, all 3 burger names, their prices, and their toppings and promotion information.
The prices should be displayed in their own cu
ency. (eg: price of an inheritance burger is $3.0, your country’s exchange rate is 500 and use €, price of the burger is € 1500)
If the country promotes a special event, all the Burger211 shops in the country participate to the promotion event.
eg) During the coronavirus pandemic, price of all the burgers are 50% off at all the Burger211 shops in USA.
If people in the country never eat chicken meat, you can remove chicken from the toppings.
Your second assignment is to develop an app for CS211 Inc.
Desired Output
5
Menu.java
(GUI)
Super class
Burger211.java
USA.java
anyCountry.java
myBurger211.java
(Main program)
GUI interface is provided.
System Structure
extends
extends
Requirements. (must include)
2 countries (USA + one more country) and 2 franchises to each country.
abstract class
inheritance
constructo
un-time Polymorphism
encapsulation
ove
iding
print menu for each franchise.
Submit these 4 files
Super class
Burger211.java
USA.java
anyCountry.java
myBurger211.java
(Main program)
public class burger211 {
public static void main(String[] args) {
String franchiseName;
String Burger1Name = “inheritance Burger";
String Burger2Name = “ove
iding Burger";
String Burger3Name = “polymorphism Burger";
String Burger1Topping = “beef patty, tomato, onion, ranch source";
String Burger2Topping = “beef patty, lime, onion, lettuce, tomato source";
String Burger3Topping = “chicken
east, gallo, onion, ranch source";
Double Burger1Price=3.0; Double Burger2Price=2.0; Double Burger3Price=3.5;
franchiseName = “Bellevue”;
System.out.println(franchiseName);
System.out.println(Burger1Name + “ : “ + Burger1Price);
System.out.println(Burger1Layer);
System.out.println(Burger2Name + “ : “ + Burger2Price);
System.out.println(Burger2Layer);
System.out.println(Burger3Name + “ : “ + Burger3Price);
System.out.println(Burger3Layer);
franchiseName = “Seattle”;
System.out.println(franchiseName);
System.out.println(Burger1Name + “ : “ + Burger1Price);
System.out.println(Burger1Layer);
System.out.println(Burger2Name + “ : “ + Burger2Price);
System.out.println(Burger1Layer);
System.out.println(Burger3Name + “ : “ + Burger3Price);
System.out.println(Burger1Layer);
. . .
}
}
1,000+ Franchises!!
silly guy
8
Base image: https:
dlpng.com
9
We will learn how to develop the system tomo
ow.
But think about your approach today.