FoodOrder # date: Date # foodOrderlID: int - foodPrice: double # DISCOUNT: double + FoodOrder() + FoodOrder(orderID: int, foodPrice; |double) + setFoodPrice(foodPrice: double) + getFoodPrice(): double + calculatePayment(): double + toString(): String Delivery Dineln |- address: Address |- tableNO: int - TAX: double - distance: double Address |- deliveryFee: double + Dineln() + DineIn(foodOrderID: int, foodPrice: double, tableNO: int) + calculateTax(): double + getDineSubTotal(): double + calculateDineDiscount(): double + calculatePaymentt(): double + toString(): String + addressLine1: String + addressLine2: String + Delivery() + Delivery(foodOrderID: int, foodPrice: double, address: Address, distance: double) + getDeliveryFee(): double + getDeliverySubTotal(): double + calculateDeliveryDiscount(): double + calculatePayment(): double + toString(): String + Address() + Address(addressLine1: String, addressLine2: String)
(a) Implement ALL the classes. The formula for calculating total payment for each class is shown below:
Requirements:
− Dine-incustomer will be charged 10% TAX based on the Food Price.
− Delivery and Dine-Incustomer will be given 5% DISCOUNT for Food Price with delivery fee or tax that is more than RM100
ADDRESS LINE 1: No. 8 Jalan Cempaka ADDRESS LINE 2: Lorong Bersatu 2 DISTANCE (KM): 6.00 DATE: Mon Sep 06 22:54:34 SGT 2021 FOOD ORDER ID: 1234 FOOD PRICE: RM 49.00 DELIVERY FEE: RM 5.00 SUBTOTAL: RM 54.00 DISCOUNT: RM 0.00 TOTAL: RM 54.00 ---------------------------------------------- Dine In Customer: ---------------------------------------------- Table NO: 8 DATE: Mon Sep 06 22:54:34 SGT 2021 FOOD ORDER ID: 7890 FOOD PRICE: RM 188.00 TAX: RM 18.80 SUBTOTAL: RM 206.80 DISCOUNT: RM 10.34 TOTAL: RM196.46 |
Step by step
Solved in 5 steps