Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Computer science homework using C++, please help, thank you so much Define a structure, named CarInfo, that contains three member variables, Make (a string), Model
Computer science homework using C++, please help, thank you so much
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 whitespaces. You can safely assume that the number of cars is no more than 10. The following shows an example input 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(CarInfo 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. ALIENWARE END FY HOME F5 F6 FZ F8 F9 FIO F12 ALIEN FX T-PAD PRT SCRN PAUSEStep 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