-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
69 lines (66 loc) · 1.73 KB
/
main.cpp
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <iostream>
#include <windows.h>
#include <string.h>
#include <conio.h>
using namespace std;
#include "applicant.h"
void gotoxy(int x, int y){
HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(output, coord);
}
int main()
{
char flag = 'f';
applicant a;
char ch;
while(1){
system("cls");
gotoxy(31, 8);
cout<< " Credit Calculation";
gotoxy(31,9);
cout<< "--------------------";
gotoxy(22, 12);
cout << "1 - Enter loan Applicant Details";
gotoxy(22, 13);
cout << "2 - Display Credit Score";
gotoxy(22, 14);
cout << "3 - Exit";
gotoxy(22, 16);
cout << "Select an option by typing the Numeric code : ";
cin >> ch;
//ch = getch();
switch(ch){
case('1'):{
a.getdata();
a.display_score();
flag = 't';
break;
}
case('2'):{
if(flag == 'f'){
gotoxy(22, 18);
cout << "Loan Applicant's Details not yet entered! Press any Key to Continue...";
getch();
break;
}
else{
a.display_score();
break;
}
}
case('3'):{
exit(1);
break;
}
default:
gotoxy(22,18);
cout << "Invalid Choice press any Key to Continue.... ";
getch();
}
}
cin.get();
return 0;
}