Hello, can anyone help me with this program please? I need it in C++. I already have a bit of code that was given to me but I'm not sure how to go forward with it. Please help me. Modify the vehicle management program to allow an automobile rental company to manage its fleet of automobiles. First, define a class called CityCar that contains an array of pointers to the 100 objects in the Car class. This also allows you to store pointers to objects of the derived class types PassCar and Truck. The objects themselves will be created dynamically at runtime. Define a class CityCar with an array of pointers to the Car class and an int variable for the current number of elements in the array. The constructor will set the current number of array elements to 0. The destructor must release memory allocated dynamically for the remaining objects. Make sure that you use a virtual destructor definition in the base class Car to allow correct releasing of memory for trucks and passenger vehicles. Implement two versions of the insert() method using the prototype shown opposite. Each version will allocate memory to an object of the appropriate type-that is of the PassCar or Truck class-and use the arguments passed to it for initialization. The method should return false if it is impossible to enter another automobile (that is, if the array is full), and true in all other cases. The display() method outputs the data of all vehicles on screen. To perform this task it calls the existing display() method for each object. Create a new function called menu() and store this function in a new source file. The function will display the menu shown opposite, read, and return the user's choice. Additionally, write two functions, getPassCar() and getTruck(), which read the data for a car or a truck from the keyboard and write the data into the appropriate arguments. Create an object of the CityCar type in your main function. Insert one car and one truck. These will be the first vehicles of the company's fleet. If a user chooses "Add car" or "Add truck,” your program must read the data supplied and call the appropriate version of insert().
Hello, can anyone help me with this program please? I need it in C++. I already have a bit of code that was given to me but I'm not sure how to go forward with it. Please help me. Modify the vehicle management program to allow an automobile rental company to manage its fleet of automobiles. First, define a class called CityCar that contains an array of pointers to the 100 objects in the Car class. This also allows you to store pointers to objects of the derived class types PassCar and Truck. The objects themselves will be created dynamically at runtime. Define a class CityCar with an array of pointers to the Car class and an int variable for the current number of elements in the array. The constructor will set the current number of array elements to 0. The destructor must release memory allocated dynamically for the remaining objects. Make sure that you use a virtual destructor definition in the base class Car to allow correct releasing of memory for trucks and passenger vehicles. Implement two versions of the insert() method using the prototype shown opposite. Each version will allocate memory to an object of the appropriate type-that is of the PassCar or Truck class-and use the arguments passed to it for initialization. The method should return false if it is impossible to enter another automobile (that is, if the array is full), and true in all other cases. The display() method outputs the data of all vehicles on screen. To perform this task it calls the existing display() method for each object. Create a new function called menu() and store this function in a new source file. The function will display the menu shown opposite, read, and return the user's choice. Additionally, write two functions, getPassCar() and getTruck(), which read the data for a car or a truck from the keyboard and write the data into the appropriate arguments. Create an object of the CityCar type in your main function. Insert one car and one truck. These will be the first vehicles of the company's fleet. If a user chooses "Add car" or "Add truck,” your program must read the data supplied and call the appropriate version of insert().
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 6 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education