Пример #1
0
int main(void)
{
	int choice = 0;
	double amt = 0.0;
	Bank wsecu;

	while(choice != 7)
	{
		system("cls");
		wsecu.displayMenu();
		choice = wsecu.getMenuChoice();

		switch(choice)
		{
			case 1:
				_flushall();
				wsecu.addAccount();
				break;
			case 2:
				_flushall();
				wsecu.modifyAccount();
				break;
			case 3:
				_flushall();
				cout << "Enter amount to deposit: ";
				cin >> amt;
				wsecu.deposit(amt);
				break;
			case 4:
				_flushall();
				cout << "Enter the amount to withdraw: ";
				cin >> amt;
				wsecu.withdrawal(amt);
				break;
			case 5:
				_flushall();
				wsecu.displayAccount();
				break;
			case 6:
				_flushall();
				wsecu.deleteAccount();
				break;
			default:
				break;
		}
	}
	wsecu.~Bank();
	cout << "Thankyou for using the bank" << endl;

	return 0;
}
Пример #2
0
int main(void)
{
	//variables storing info for program
	int option = 0;
	Bank wiensBank;
	bool running = true;

	//while user didn't exit
	while(running)
	{
		//print menu and get option
		bankMenu(&option);

		switch(option)
		{
			case 1:
				//view account info
				wiensBank.viewAccount();
				break;
			case 2:
				//deposit money into account
				wiensBank.findAccount(getAcNumber())->credit();
				break;
			case 3:
				//withdraw money from account
				wiensBank.findAccount(getAcNumber())->debit();
				break;
			case 4:
				//make a new account and put it in the bank
				wiensBank.insertAccount();
				break;
			case 5:
				//delete an account
				wiensBank.deleteAccount();
				break;
			case 6:
				//print exit message and exit
				system("cls");
				cout << "Thank you for visiting WiensBank! Goodbye!" << endl;
				running = false;
				break;
		}
	}

	return 0;
}