Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ffQuestion 1 Referring to Question 1. write a prograrn in another file named then-rain . opp in order to execute the classes created in Question
\f\fQuestion 1 Referring to Question 1. write a prograrn in another file named then-rain . opp in order to execute the classes created in Question 1. The program should prompt users to input the type of vehicle (car or motorcycle) before proceeding to ask for first name, last name, and vehicle price. Your program will loop to process multiple vehicles until value zero {0] is keyed in as a sentinel value to stop the program. Your main {1: function should contain the following elements. 3 o vehicle *t 1130]; *t [1130] is a class vehicle pointer array that instantiate list of objects from both clams car and class metereyele. o Sufcient variables to preliminaryI store values for type of vehicle, first name, last narne, vehicle price, loop counters and sentinel value. In Variable type is used for vehicle type selection. If type == 1, an object pointer for class ear is created, while if type == 2. an object pointer for class motorcycle is created. You may use any preferred selection structure. In Member function di splay { 1: will be called before the end of each loop. Refer to Figure CI for the nal output. \f
Step 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