Ich mache einen Steuerrechner in C++, aber ich habe einen Fehler Es soll mehrere Daten eingeben: Art des Fahrzeugs, Datum und Modell. Aber das Programm fragt mich erst einmal vor Pause und geht nicht weiter.Steuerrechner Pause Programm
Es wird angenommen, dass die Operation wie folgt ist: Sie geben einen Fahrzeugtyp, dann das Ausstellungsdatum und schließlich seinen Preis ein.
Angesichts dieser Daten soll das Programm den Prozentsatz der Steuern berechnen, die enthalten sein müssen.
Aber wie gesagt, das Programm wird pausiert, bevor die zweiten Daten, das Jahr gefragt werden.
Dies ist der 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;
}
irgendwelche Vorschläge?
'cin >> d;' meinst du 'cout << d;'? – DimChtz
Wenn das die Ausgabe Nic ist, warum wirst du es "eingeben" und nicht "ausgeben"? Warum denkst du, dass "cout << d" nicht die Lösung ist? –
Drücken Sie nach dem Einfügen des Fahrzeugtyps die Eingabetaste? –