Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Question 3 Referring to Question 2, write a program in another file named themain.cpp in order to execute the classes created in Question 2.

image text in transcribed
C++
Question 3 Referring to Question 2, write a program in another file named themain.cpp in order to execute the classes created in Question 2. The program should prompt users to input the type of food (roti canai or nasi goreng) before proceeding to asking for each order's first name, last name, and number of orders. Your program will iterate to reserve the orders until character "N" or "n" is keyed in as a sentinel value to stop the program. Your main() function should contain the following elements. belumMakan *t (50); *+50) is a class belumMakan pointer array that instantiate list of objects from both class rotiCanai and class nasi Goreng. Sufficient variables to preliminary store values for first name, last name, number of orders, food type, loop counters and sentinel value. Variable type is used for food type selection. If type == 1, an object pointer for class rotiCanai is created, while if type == 2, an object pointer for class nasi Goreng is created. You may use any preferred selection structure. Member function displayOrder () will be called before the end of each loop. Refer to Figure 14 for the final output. Question 3 Referring to Question 2, write a program in another file named themain.cpp in order to execute the classes created in Question 2. The program should prompt users to input the type of food (roti canai or nasi goreng) before proceeding to asking for each order's first name, last name, and number of orders. Your program will iterate to reserve the orders until character "N" or "n" is keyed in as a sentinel value to stop the program. Your main() function should contain the following elements. belumMakan *t (50); *+50) is a class belumMakan pointer array that instantiate list of objects from both class rotiCanai and class nasi Goreng. Sufficient variables to preliminary store values for first name, last name, number of orders, food type, loop counters and sentinel value. Variable type is used for food type selection. If type == 1, an object pointer for class rotiCanai is created, while if type == 2, an object pointer for class nasi Goreng is created. You may use any preferred selection structure. Member function displayOrder () will be called before the end of each loop. Refer to Figure 14 for the final output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

Students also viewed these Databases questions