I'm doing a tax calculator in C ++ but I have an error It is supposed to enter several data: Type of vehicle, date and model. But the program asks me only one before pause and does not go ahead.
It is assumed that the operation is as follows: You enter a type of vehicle, then the date of issuance, and finally its price.
Given these data, the program is supposed to calculate the percentage of tax that must be included.
But as I said, the program is paused before asking the second data, the year.
This is the code
#include <iomanip>
#include <iostream>
using namespace std;
int main(){
std:string a;//tipo
int b;//año
double c;//precio
char d;//resultado
cout << "Ingrese el tipo:";
cin >> a;
cout << "Ingrese el año:";
cin >> b;
cout << "Ingrese el precio:";
cin >> c;
if (a = "automovil" && b <= 1980){
d = c*100/3.3;
}else if ( a == "automovil" && b <= 1990){
d = c*100/5.5;
}else if ( a == "automovil" && b <= 2000){
d = c*100/7;
}else if ( a == "automovil" && b <= 2010){
d = c*100/10;
}else if ( a == "camioneta" && b <= 1980){
d = c*100/3.3;
}else if ( a == "camioneta" && b <= 1990){
d = c*100/5.5;
}else if ( a == "camioneta" && b <= 2000){
d = c*100/7;
}else if ( a == "camioneta" && b <= 2010){
d = c*100/10;
}else if ( a == "camion" && b <= 1980){
d = c*100/3.3;
}else if ( a == "camion" && b <= 1990){
d = c*100/5.5;
}else if ( a == "camion" && b <= 2000){
d = c*100/7;
}else if ( a == "camion" && b <= 2010){
d = c*100/10;
}else if ( a == "volqueta" && b <= 1980){
d = c*100/3.3;
}else if ( a == "volqueta" && b <= 1990){
d = c*100/5.5;
}else if ( a == "volqueta" && b <= 2000){
d = c*100/7;
}else if ( a == "volqueta" && b <= 2010){
d = c*100/10;
}
cout << d;
return 0;
}
any suggestions?