Question
C++ CODE. A) Create a super class named Order that contains the following data fields (private variables). Order Number (int) Order Type (String) Include get
C++ CODE.
A) Create a super class named Order that contains the following data fields (private variables).
Order Number (int)
Order Type (String)
Include get and set methods for these fields, a default constructor with no parameter and an overloaded constructor that has two parameters, order number and order type. B) Create a subclass of Order Class named Food that contains the following data fields (private variables).
Food Type (String)
Food Name (String)
Quantity (int)
Price (double)
Include get and set methods for these fields, a default constructor with no parameter and an overloaded constructor that has six parameters, order number, order type, food type, food name, quantity and price. Create another method named subtotal that performs multiplication of price and quantity and return the result as double type. C) Create a cpp program (named Billing then create the following objects and display the objects based on the instruction below.
Create a Food object named item1 using its default constructor. Use set method to assign the following values, 1, Dine-in, Appetizer, Fried Caramari, 1, and 6.95 to order number, order type, food type, food name, quantity and price respectively.
Create a Food object named item2 using its overloaded constructor with six parameters. Assign the following values, 1, Dine-in, Entree, Grilled Salmon, 2, and 15.99 to parameters, order number, order type, food type, food name, quantity and price respectively.
Display billing summary by using get methods and subtotal method as shown below. Use 10% for tax.
Output From Billing.cpp Billing Summary - Dine-in Order No. 1 Appetizer Fried Caramari 1x6.95 6.95 Entree Grilled Salmon 2x15.99 31.98 Subtotal: 38.93 Tax: 3.89 Total: 42.82Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started