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, colour price and the price based on the colour of the car
#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