Hi guys I'm trying to do this java exercise and I'm getting nowhere with this So I was wondering if anyone can help me out with this.
1. Create a PizzaOrder.java class with the following attributes and methods:
+PizzaOrder(size: String, toBeDelivered: boolean)
+setSize(size: String): void
+setToBeDelivered(toBeDelivered: boolean): void
“small” – small
“medium” – medium
“large” – large
“extra” – extra large
The price should be calculated as the following:
Small pizza: 6.99
Medium pizza: 8.99
Large pizza: 10.99
Extra large pizza: 12.99
If user wants the pizza to be delivered, add additional $3.00 as the tip.
2. Under the same project, create a PizzaWithToppings Class, which is a subclass of PizzaOrder class.
+PizzaWithToppings(sausage: boolean, pepperoni: boolean, peppers: boolean, size: String, toBeDelivered: boolean)
+isPepperoni (): boolean
+isPeppers (): boolean
+setSausage(sausage: boolean): void
+setPepperoni (pepperoni: boolean): void
+setPeppers (pepprers: boolean): void