Write a C++ program that uses a structure to store records of cars. A car record contains seating_capacity (integer), model_year (string), car_type(String), and Engine_type as Eng. (Engine). The field Engine_type is of type Engine, a separately declared structure that contains three fields Capacity(int) in CC, Power (int) in horsepower, and No_of_cylenters(int). Now in main function you are required to declare a car C1, take input from user, for car_type, model_year, and car_type, Capicity, and show it as an output. Sample Input: Please enter car_type C1: Toyota Sedan Please enter model year for Toyota Sedan: 2020 Please enter capacity for Toyota Sedan 2020: 1300 Please enter power for Toyota Sedan: 200 Sample Output: Toyota Sedan model 2020 is 1300 cc with 150 horsepower
Q5:
Write a C++ program that uses a structure to store records of cars. A car record contains seating_capacity (integer), model_year (string), car_type(String), and Engine_type as Eng. (Engine). The field Engine_type is of type Engine, a separately declared structure that contains three fields Capacity(int) in CC, Power (int) in horsepower, and No_of_cylenters(int). Now in main function you are required to declare a car C1, take input from user, for car_type, model_year, and car_type, Capicity, and show it as an output.
Sample Input:
Please enter car_type C1: Toyota Sedan
Please enter model year for Toyota Sedan: 2020
Please enter capacity for Toyota Sedan 2020: 1300
Please enter power for Toyota Sedan: 200
Sample Output:
Toyota Sedan model 2020 is 1300 cc with 150 horsepower
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images