Please help, this question was rejected for complexity but I really don't have any one else to ask! I would really like to see what I got wrong so if anyone can solve this please help! Write a complete C++ program with the following: A struct named Car with member variables to store car make, model, and price. A function named setCar that returns a Car and has no parameters. setCar will: prompt the user for a car name, model, and price, and return that car. A void function named showCars with 2 parameters: a constant Car array named cars, and a constant integer named SIZE. The showCars function will: Use a loop to display the make, model, and price of each car in the cars array, and will also display what that car’s position is in the array (for regular computer users who start counting from 1, not programmers who start counting from 0). In the main function Declare a constant integer named SIZE with the value of 3. Declare a Car array the size of SIZE. Write a loop to call your setCar function, and populate each car in your array. Your loop will also identify which car your are getting details for Call your showCars function, to display all of the cars in your array. Declare an integer array named nbrs the size of SIZE with the values: 200, 300, and 100. Write a loop that: Displays each number. ALSO in your loop, find out which number is the largest number. After the loop, display your variable with the largest number. Declare 2 constant integers: ROW with a value of 2, and COL with a value of 5. Declare a 2-dimensional array named pets the size of ROW and COL. Populate it with 5 cats and 5 dogs. Write a nested loop to display all cats and dogs
C++ HELP!
Please help, this question was rejected for complexity but I really don't have any one else to ask! I would really like to see what I got wrong so if anyone can solve this please help!
Write a complete C++ program with the following:
A struct named Car with member variables to store car make, model, and price.
A function named setCar that returns a Car and has no parameters. setCar will:
prompt the user for a car name, model, and price, and return that car.
A void function named showCars with 2 parameters: a constant Car array named cars, and a constant integer named SIZE. The showCars function will:
Use a loop to display the make, model, and price of each car in the cars array, and will also display what that car’s position is in the array (for regular computer users who start counting from 1, not programmers who start counting from 0).
In the main function
Declare a constant integer named SIZE with the value of 3.
Declare a Car array the size of SIZE.
Write a loop to call your setCar function, and populate each car in your array. Your loop will also identify which car your are getting details for
Call your showCars function, to display all of the cars in your array.
Declare an integer array named nbrs the size of SIZE with the values: 200, 300, and 100.
Write a loop that:
Displays each number.
ALSO in your loop, find out which number is the largest number.
After the loop, display your variable with the largest number.
Declare 2 constant integers: ROW with a value of 2, and COL with a value of 5.
Declare a 2-dimensional array named pets the size of ROW and COL.
Populate it with 5 cats and 5 dogs.
Write a nested loop to display all cats and dogs.
Step by step
Solved in 2 steps with 1 images