ok i just startet coding c++ and ofc im geting alot of errors. but until now ive been able to fix them myself but when i try to debug my program it says misplaced else and i just cant find out how to get it to work. so well heres my code:
#include <iostream.h>
#include <conio.h>
main()
{
int kwh,rate1,rate2,base1,base2,rate3,regning;
rate1=22;
rate2=33;
rate3=15;
base1=25;
base2=35;
cout << "indtast hvor mange kwh du bruger: ";
cin >> kwh;
if (kwh<=20)
{
regning=+rate1*kwh;
cout << "din regning er på " << regning << " kr." << endl;
}
else
{
if ((kwh>=20) && (kwh<=40))
regning=+base1+rate2*kwh;
cout << "din regning er på " << regning << " kr." << endl;
}
else
{
if (kwh>=40)
regning=+base2+rate3*kwh;
cout << "din regning er på " << regning << " kr." << endl;
cout << "og du skal nok til at spare lidt på strømmen" << endl;
}
getch();
}
hope some of you can help me with this :).
oh and ofc just corect me in any error you find :P