Suppose you work for an employer that sells vehicles and your employer instructs you to design a program using the C++ language to determine the car that corresponds to the price that your program calculated. The price of the car is determined by adding three(3) prices: which are engine price, color price, and the price based on the color of the car. The engine price ranges between R500 000 – R2000000-00. The colour of the car ranges between R7000 – R10000
The price based on the power of the car ranges between R300 000 – R600 000. If the sum of the three(3) prices is between R700 000 – R1000000, the program must display that the car is in the range of a VW Golf 8 GTI. If the sum of the three(3) prices is between R1100000-1800000, the program must display that the car is in the range of a Mercedes Benz GLC63s. If the sum of the three(3) prices is between R1900 000 – R2500000, the program must display that the car is in a range of a BMW M8 challenger. DESIGN YOUR A PSEUDOCODE
#include <iostream>
#include <string>
using namespace std;
int main(){
float price;
float totalPrice=0;
cout<<"Enter the engine price of the car: ";
cin>>price;
totalPrice+=price;
cout<<"Enter the colour price of the car: ";
cin>>price;
totalPrice+=price;
cout<<"Enter the power price of the car: ";
cin>>price;
totalPrice+=price;
cout<<"The price of the car: "<<totalPrice<<"\n";
int k;
cin>>k;
return 0;
Comments
Leave a comment