C++ HELP! NO STRUCTURES USED! Hello I've tried to ask this question before, but the answer I received was incorrect, so I am asking once again for someone to help me with this problem. 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. Sample output: Get car 1 details Enter make: Ford Enter model: Mustang Enter price: 28000 Get car 2 details Enter make: Chevy Enter model: Corvette Enter price: 42000 Get car 3 details Enter make: Jeep Enter model: Cherokee Enter price: 26000 Car 1 details: make Ford, model Mustang, price 28000 Car 2 details: make Chevy, model Corvette, price 42000 Car 3 details: make Jeep, model Cherokee, price 26000 Nbr is: 200 Nbr is: 300 Nbr is: 100 Max number is: 300 Pets table CATS: Siamese Burmese Persian Tabby DOGS: Collie Poodle Labrador Beagle
C++ HELP! NO STRUCTURES USED!
Hello I've tried to ask this question before, but the answer I received was incorrect, so I am asking once again for someone to help me with this problem.
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.
Sample output:
Get car 1 details
Enter make: Ford
Enter model: Mustang
Enter price: 28000
Get car 2 details
Enter make: Chevy
Enter model: Corvette
Enter price: 42000
Get car 3 details
Enter make: Jeep
Enter model: Cherokee
Enter price: 26000
Car 1 details: make Ford, model Mustang, price 28000
Car 2 details: make Chevy, model Corvette, price 42000
Car 3 details: make Jeep, model Cherokee, price 26000
Nbr is: 200
Nbr is: 300
Nbr is: 100
Max number is: 300
Pets table
CATS: Siamese Burmese Persian Tabby
DOGS: Collie Poodle Labrador Beagle
Step by step
Solved in 2 steps with 4 images