Question
C++ You are to write a class called Car. The car has the following private variables Make Model Year Cylinders You are to write the
C++
You are to write a class called Car. The car has the following private variables
- Make
- Model
- Year
- Cylinders
You are to write the Constructor (default and the full one) and the functions for this class.
In the main, you are going to input (from a file called "cars.txt") all the cars and place them in an array of Car objects you make in the main.
You should then be able to display all the information correctly on the screen from the Objects.
Your program should then be able to search the array for a specific car based on the choice between: Make, Model, Year or number of Cylinders.
Display the items retrieved by the search on the screen.
cars.txt
Volkswagen Jetta 2016 4 Jeep Wrangler 2008 6 Toyota Corolla 1999 4 Chevy Malibu 2018 6 Chevy Malibu 2014 6 BMW 320i 2014 6 Jeep GrandCharokeeLaredo 2006 6 Ford Fusion 2012 4 Chevy Equinox 2015 4 Volkswagen Jetta 1998 4
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