Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C++) Define a structure, named CarInfo, that contains three member variables, Make (a string), Model (a string), and Year (an integer). Write a program that

(C++) Define a structure, named CarInfo, that contains three member variables, Make (a string), Model (a string), and Year (an integer).

Write a program that takes the user input of a number of cars' information including their model, make and year. The input starts with an integer indicating the number of cars that will follow. Each car's information is entered in a separate line. The model, make, and year information of each car are separated by white spaces. You can safely assume that the number of cars is no more than 10. The following shows an example input.

image text in transcribed

image text in transcribed

3 Nissan Versa 2012 Ford Explorer 2020 Nissan Sentra 2020 (1) The program then outputs the car information received For example, given the above input, the program will output You entered: Nissan Versa 2012 Ford Explorer 2020 Nissan Sentra 2020 (2) Next, the program will get a year (integer) from the user and print all cars made during or after that year. For example, if the integer entered is 2020, given the input above the output would be: Cars produced after 2020 in inventory: Ford Explorer 2020 Nissan Sentra 2020 If no car is found, print the message: No car produced after year> in inventory The array search and output must be produced by a function: bool printCarsByYear(Car Info cars[], int nCars, int year); Additionally, the function will return false if no car in the array matches the search information, otherwise, it will return true. Call the function in main to complete the search and print the output. If these tasks are not completed by the function or the function is not called correctly, the corresponding test case(s) will be considered failed

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

Step: 3

blur-text-image

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

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

What is conservative approach ?

Answered: 1 week ago

Question

What are the basic financial decisions ?

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago