ok ive got my program to work now but cant get it to ask me if i want it to make a new calculation and i need to do this with a while command i dont what a done code out of you ppl cause its my homework and i want to learn this i just want some tips or hints :P
well my code is:
#include <iostream.h>
#include <conio.h>
int main()
{
int kwh, rate1 = 22, rate2 = 33, rate3 = 40,slut=0;
int base1 = 25, base2 = 35, regning = 0;
char bogstav;
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>=21) && (kwh<=40))
{
regning=+base1+rate2*kwh;
cout << "din regning er på " << regning << " kr." << endl;
}
else
{
if (kwh>=41)
regning=+base2+rate3*kwh;
cout << "din regning er på " << regning << " kr." << endl;
cout << "og du skal nok til at skære lidt ned på dit forbrug" << endl;
}
getch();
}
hope some one can help me :P