Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

#include <iostream>

#include <stdio.h>

#include <istream>

#include <fstream>

#include <stdlib.h>

#include <math.h>

#include <string.h>

#include <conio.h>

using namespace std;

int main()

float deposit, cashout, total, interest, us, jp, cy, eu, am;

int ced, j, p;

char q;

string name, pass1, pass3;

cout<<"----Registration Screen----"<<endl;

cout<<"Enter Username:"<<endl;

getline (cin, name);

cout<<"Enter Password:"<<endl;

cin>>pass1;

ifstream input("database.txt");

system("CLS");

cout<<"Registration Complete!!!"<<endl;cout<<"Press any Key to continue"<<endl;

cin>>q;

getch();

system("CLS");

cout<<"--------JOESTAR_BANK.com--------"<<endl;
cout<<" "<<endl;

cout<<"LOG IN:"<<endl;

cout<<"HELLO!!!!"<<name<<" !!!"<<endl;

cout<<"Enter password:"<<endl;

cin>>pass3;

if (pass1 == pass3) {

HEY:

cout<<"-------WELCOME! "<<name<<"!!!-------"<<endl;

cout<<">>>>>>Main Menu<<<<<<"<<endl;

cout<<"Your Balance is: "<<total<<endl;

cout<<"Choose between the following options:"<<endl;

cout<<"[1] Deposit to your account."<<endl;

cout<<"[2] Withdraw from your account."<<endl;

cout<<"[3] Close the program."<<endl;

cin>>ced;

switch (ced) {

case 1:

cout<<"Enter the amount: "<<endl;

cin>>deposit;

total = total + deposit;

cout<<"You deposited: "<<deposit<<endl;

cout<<"Your total money: "<<total<<endl;

cin>>q;

getch();

system("CLS");

cout<<"Would you like to exchange your Peso rate into Foreign Currency?"<<endl;
cout<<"Choose [4] for yes."<<endl;

cout<<"Choose [5] to go back to main menu."<<endl;

cin>>j;

ifstream input("database.txt");

system("CLS");

if (j == 5){

goto HEY;

if (j == 4) {

cout<<"Choose between the following rates:"<<endl;

cout<<"[6] for US Dollars."<<endl;

cout<<"[7] for Japanese Yen."<<endl;

cout<<"[8] for Chinese Yuan."<<endl;

cout<<"[9] for Euro."<<endl;

cin>>p;

if (p == 6) {

cout<<"Enter the amount to be exchanged: "<<endl;

cin>>am;

us = am * 0.018;

total = total - am;

cout<<"Thank you !"<<name<<" You Exchanged: "<<am<<endl;

cout<<"You have: "<<us<<"US Dollars"<<endl;

cout<<"Your remaining balance is: "<<total<<endl;

getch();

system("CLS");

goto HEY;

}if (p == 7) {

cout<<"Enter the amount to be exchanged: "<<endl;

cin>>am;
jp = am * 0.018;

total = total - am;

cout<<"Thank you !"<<name<<" You Exchanged: "<<am<<endl;

cout<<"You have: "<<jp<<"Japanese Yen"<<endl;

cout<<"Your remaining balance is: "<<total<<endl;

getch();

system("CLS");

goto HEY;

if (p == 8) {

cout<<"Enter the amount to be exchanged: "<<endl;

cin>>am;

cy = am * 0.13;

total = total - am;

cout<<"Thank you !"<<name<<" You Exchanged: "<<am<<endl;

cout<<"You have: "<<cy<<" Chinese Yuan"<<endl;

cout<<"Your remaining balance is: "<<total<<endl;

getch();

system("CLS");

goto HEY;

if (p == 9) {

cout<<"Enter the amount to be exchanged: "<<endl;

cin>>am;

eu = am * 0.017;

total = total - am;

cout<<"Thank you !"<<name<<" You Exchanged: "<<am<<endl;

cout<<"You have: "<<eu<<" Euro"<<endl;


cout<<"Your remaining balance is: "<<total<<endl;

getch();

system("CLS");

goto HEY;

if (j ==5) {

goto HEY;

case 2:

cout<<"Enter the amount: "<<endl;

cin>>cashout;

total = total - cashout;

cout<<"You withdrawed: "<<cashout<<endl;

cout<<"Balance Remaining: "<<total<<endl;

cout<<">>Back to Main Menu: Press any Key<<"<<endl;

cin>>q;

system("CLS");

goto HEY;

break;

}
case 3:

goto END;

else {

cout<<"The password don't match, please try again.";

END:

return 0;

Final note:

The biggest mistake that I did RIGHT after making the video for hours is that I messed up really bad with
the equations for the total - exchange amount. The name variable doesn't accept space between it so I
added a getline for this version. Another mistake that I realized after testing it after finishing the video
edit is the function where the exchanged value doesnt stack which I all fixed in this more, finalized
version. Im sorry ma'am and I hope you consider that mistake because I did my best making this code
despite being mediocre at best. The hardware final project and the quizzes are basically my fist time
editing a video in my entire life so excuse the cringe that I made. Merry Christmas and thank you very
much.

You might also like