Question
In C++... 1) Create the following car data in parallel arrays (set these values with an initialization list or otherwise set the values inside the
In C++...
1) Create the following car data in parallel arrays (set these values with an initialization list or otherwise set the values inside the program.) You may also use parallel vectors if you would like. It is up to you. Make Model Color Year Mileage VIN 1. Porsche 911 Silver 2005 18990 1237362 2. Ford Mustang Red 2007 49842 7337372 3. Chevrolet Beretta Black 1989 90332 2873644 4. Ford Focus White 2008 150 9236498 5. Voltzwagon Jetta Black 2006 28002 4673992 6. Rolls Royce Ghost Silver 2005 10000 9292983 7. Mazda 626 Blue 2002 84754 7364646 8. Toyota Camry Red 2004 50332 2133737 9. <
2) Set a pointer to each of the arrays that hold the information on the sample items in inventory. Demonstrate pointer arithmetic (page 508-511) by writing a loop that prints out all of the values in the Car arrays for the user and uses the pointers and pointer arithmetic 3) Ask the user for a value to change for a car in the array (for a part of a car you choose like color or year) and change that value through a pointer. Ask the user for a value to change for a different car in the array (for a part of a car you choose like color or year) and change that value through a pointer.
4) Redisplay the array to show the values in the current set of car data by using pointers, and pointer arithmetic to see the two changed values.
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