Hello,this is my first topic in the programming section, i started to learn programming and i am still a beginner so this is one of my first programs, the programs is to calculate the price of a car rental based on which car you choose and the number of kilometers passed by the car,i know that the program is maybe not very well polished but it's one of my first tries.so here is the program...
#include <iostream>
using namespace std;
int car,carp;
double lesthn100,morethn100,price,KM;
int main ()
{
cout<<"1: $500 \n\n2: $600 \n\n3: $700 \n\nPlease enter the number of the car: ";
cin>>car;
if (car == 1)
carp = 500;
else if (car == 2)
carp = 600;
else if (car == 3)
carp =700;
else {cout<<"invalid number!";
cin.get();
cin.get();
return 0;
}
cout<<"\nPlease enter number of KM: ";
cin>>KM;
if (KM <= 100){
price = (KM*0.25)+carp;
cout<<"\nthe price is: $"<<price;
}
else if (KM > 100) {
lesthn100 = 100*0.25;
morethn100 = (KM-100)*0.15;
price = lesthn100+morethn100+carp;
cout<<"the price is: $"<<price;
}
cin.get();
cin.get();
return 0;
}
so what you think ? finally now i am thinking of creating a GUI for the program so if you can give me any help a good link or a tool . thanks (although after googeling i found that it's hard to make a GUI for an already written code.)