소스 검색

Removed quit()

- void quit() is now commented
- Added some more comments
Fixing-travis-yml
BinHong Lee 8 년 전
부모
커밋
c8963dd091
1개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. +12
    -4
      LogInSystem.cpp

+ 12
- 4
LogInSystem.cpp 파일 보기

@@ -1,6 +1,6 @@
/* /*
* Written by : BinHong Lee * Written by : BinHong Lee
* Last edited : 5/12/2016
* Last edited : 7/7/2016
*/ */


#include <iostream> #include <iostream>
@@ -22,7 +22,7 @@ void chgUsername();
void chgPassword(); void chgPassword();
void chgEmail(); void chgEmail();
void chgPhoneNo(); void chgPhoneNo();
void quit();
//void quit();


//Stacks to store the users' personal data //Stacks to store the users' personal data
stack<Person> users; stack<Person> users;
@@ -124,7 +124,7 @@ void login()
{ {
//Print error message and exit //Print error message and exit
cout << "Too much failed login attempt. The program will now be terminated." << endl; cout << "Too much failed login attempt. The program will now be terminated." << endl;
quit();
return;
} }


try { try {
@@ -233,26 +233,32 @@ void registration()


void loggedIn() void loggedIn()
{ {
//Declare space to save user's option
int choice; int choice;


//Print options
cout << "Please choose one of the following option :" << endl; cout << "Please choose one of the following option :" << endl;
cout << "View credentials - 1" << endl; cout << "View credentials - 1" << endl;
cout << "Edit credentials - 2" << endl; cout << "Edit credentials - 2" << endl;
cout << "Exit - 0" << endl; cout << "Exit - 0" << endl;
//Get user selection
cin >> choice; cin >> choice;


switch (choice) switch (choice)
{ {
case 1: case 1:
//Print out user credentials
cout << "Username : " << currentUser.getName() << "\nEmail : " << currentUser.getEmail() << "\nPhone No. : " << currentUser.getPhoneNo() << endl; cout << "Username : " << currentUser.getName() << "\nEmail : " << currentUser.getEmail() << "\nPhone No. : " << currentUser.getPhoneNo() << endl;
//Nested call back into the menu
loggedIn(); loggedIn();
break; break;
case 2: case 2:
editCredentials(); editCredentials();
//Nested call back into the menu
loggedIn(); loggedIn();
break; break;
case 0: case 0:
quit();
break;
default: default:
cout << "Invalid option. Please try again." << endl; cout << "Invalid option. Please try again." << endl;
cout << endl; cout << endl;
@@ -392,6 +398,7 @@ void chgPhoneNo()
update(currentUser); update(currentUser);
} }


/*
void quit() void quit()
{ {
ofstream fout("database.txt"); ofstream fout("database.txt");
@@ -404,3 +411,4 @@ void quit()


exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
} }
*/

불러오는 중...
취소
저장