summaryrefslogtreecommitdiffstats
path: root/Bachelor/Softwaretechnik/swtBank/main.cpp
blob: ec2dff1c93e7d8009e033fbfd58e2100a9c41185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
#include "girokonto.hpp"

using std::cout;
using std::cin;
using std::endl;

int main()
{
	Girokonto giro;
	int select;
	float betrag;
	
	do {
		cout << "GIROKONTO" << endl;
		cout << "1: Geld einzahlen" << endl;
		cout << "2: Geld abheben" << endl;
		cout << "3: Kontostand anzeigen" << endl;
		cout << endl << "0: Ende" << endl;
		cout << endl << "Eingabe: ";
		cin >> select;
		switch (select)
		{
			case 1: {
				cout << endl << "Betrag: ";
				cin >> betrag;
				giro.geldEinzahlen(betrag);
				break;
			}
			case 2: {
				cout << endl << "Betrag: ";
				cin >> betrag;
				if (true == giro.pruefeUeberziehungsKredit(betrag))
				{
					giro.geldAbheben(betrag);
					cout << endl << "Passt scho..." << endl;
				}
				else
				{
					cout << endl << "nix gibts, leider pleite" << endl;
				}
				break;
			}
			case 3: {
				cout << endl << "Kontostand: "<<giro.getKontostand() << endl;
				break;
			}
			default: break;
		}
	} while (select!=0);
	
	return 0;
}