Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 4: Write a driver function called searchVehicleInventory that takes a VehicleType array object and its size as parameters. The function should prompt the user

Exercise 4: Write a driver function called searchVehicleInventory that takes a VehicleType array object and its size as parameters. The function should prompt the user for the year of the vehicle they are searching for and prints all the vehicles with the same year. If there is no vehicle made in the year in question, display the message "No vehicle produced in found." Allow the user to keep entering different years until -1 is seen. (15pts)

Exercise 6: Write the tests to the VehicleType object to the driver.cpp file. Include only the necessary preprocessor directives, the driver function prototypes, the main function which includes the calls to the defined driver functions in exercise 4, and the driver function definitions themselves. To properly call the previously listed driver and member functions, the main function must declare all the appropriate variables as follows:

A VehicleType array that holds 8 vehicles stored in a file

Two pointType objects whose member values are provided by the user

File input (Note: the name of the file is called myVehicleList.txt)

Add a separate driver function definition to initialize the values of the VehicleType array object with values from a file (called initVehicleInvetory).

Copy and paste your code below and include a screenshot of a successful run on the program (40pts)

/*PASTE CODE HERE -- just the function definition in the driver.cpp file */

== myVehicleList.txt data ==

Toyota Camry 2012 15500 used Red Sedan

Subaru Outback_Premium 34500 certified Maroon Wagon

Honda CR-V_EXL 2016 25950 used Grey SUV

Lexus NX250_Premium 2022 new White SUV

Kia Sorento_SX 2016 22451 used Black SUV

Toyota Camry_Solara 2023 30494 used Red Coupe

Ford Mustang_GT 2022 43145 new Midnight_blue Sports_car

Alfa_Romeo Giulia_Ti 2022 44945 certified Silver Sedan

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

More Books

Students also viewed these Databases questions

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago