Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio.h>
- using namespace std;
- int main()
- {
- const int iBio = 5;
- const int iGeringerVerbrauch = 5;
- const int iPreis = 15;
- int iJahresverbrauch;
- float fTagesverbrauch;
- bool bBio;
- cout << "Wie hoch ist ihr jaehrlicher Verbrauch: ";
- cin >> iJahresverbrauch;
- fTagesverbrauch = (float)iJahresverbrauch/365;
- cout << endl << endl << "Jahresverbrauch: " << iJahresverbrauch << endl << "Tagesverbrauch: " << fTagesverbrauch;
- cout << endl << endl << "Nutzen sie Oekostrom?: ";
- cin >> bBio;
- if(iJahresverbrauch < 10000 && !bBio)
- {
- float iErgebnis = (float)iJahresverbrauch * ((float)iPreis + (float)iGeringerVerbrauch);
- cout << endl << endl << "Ihre jaehrlichen Stromkosten betragen: " << iErgebnis;
- }
- else if(iJahresverbrauch >= 10000 && !bBio)
- {
- float iErgebnis = (float)iJahresverbrauch * (float)iPreis;
- cout << endl << endl << "Ihre jaehrlichen Stromkosten betragen: " << iErgebnis;
- }
- else if(iJahresverbrauch < 10000 && bBio)
- {
- float iErgebnis = (float)iJahresverbrauch * ((float)iPreis + (float)iGeringerVerbrauch + (float)iBio);
- cout << endl << endl << "Ihre jaehrlichen Stromkosten betragen: " << iErgebnis;
- }
- else if(iJahresverbrauch >= 10000 && bBio)
- {
- float iErgebnis = (float)iJahresverbrauch * ((float)iPreis + (float)iBio);
- cout << endl << endl << "Ihre jaehrlichen Stromkosten betragen: " << iErgebnis;
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement