I agree with arithma. You should maybe think of starting with an easier language. There is no "beginner-perfect" language. It depends on what you want to do and your personal preferences. I would strongly recommend Python, which makes programming really fun while allowing you to create really cool things in no time.
As for the C++ code you posted, I reviewed it and here are my remarks. I should say that I'm not a C++ developer, I code mainly in C; so some things might be different between the two languages. If I'm mistaken in what I'm writing, by all means somebody please correct me.
l3-l4: Don't declare your variables there. You should be declaring them inside the main function.
l8-l15: Try to use a
switch() statement instead of nested if/else if/else. It makes the code cleaner.
l26: You can simply replace this by "else"; no need to add the condition.
l27: You don't need to declare a variable if its value is not going to change. You can replace it by the value directly, or use a
preprocessor macro.
General: review your identation and add comments. It's true that this particular piece of code is small and comprehensible, but it wouldn't hurt to take up good practice from the start.
I have rewrote your code by incorporating the remarks above. Here it is. Make sure to read it and understand it, and understand why those changes make the code better.
#include <iostream>
#define FIRST100KM_PRICE 100*0.25
using namespace std;
int main (){
int car,carp;
double lesthn100,morethn100,price,KM;
// Picks a car category.
cout<<"1: $500 \n\n2: $600 \n\n3: $700 \n\nPlease enter the number of the car: ";
cin>>car;
switch (car){
case 1: carp = 500; break;
case 2: carp = 600; break;
case 3: carp = 700; break;
default: cout<<"invalid number!";cin.get();return 0;
}
// Caluclates price based on KM.
cout<<"\nPlease enter number of KM: ";
cin>>KM;
if (KM <= 100){
price = (KM*0.25)+carp;
cout<<"\nthe price is: $"<<price;
}
else {
morethn100 = (KM-100)*0.15;
price = FIRST100KM_PRICE + morethn100 + carp;
cout<<"the price is: $"<<price;
}
cin.get();
return 0;
}