I need complete explanation of c++ code line by line. Need Explanation of all lines of code what is happening in this code where the data is stored.?  Code #include #include #include #include #include #include #include using namespace std; class Bank { public: }; class ATMAccountHolders:public Bank { string accountHolders; string accountHoldersAddress, branch; int accountNumber; double startBalance; double accountBalance; double amount; int count; public: void deposit(); void withdraw(); void accountExit(); ATMAccountHolders() { accountNumber = 7787; accountHolders = " Ammad Naseer"; accountHoldersAddress = " House no.112"; startBalance = 6000.00; accountBalance = 6000.00; branch = " Islamabad"; amount = 20000; } }; void ATMAccountHolders::deposit() { system("cls"); cout<<" ATM ACCOUNT DEPOSIT SYSTEM "; cout<<"\n\nThe Names of the Account Holders are :"<>amount; accountBalance=startBalance+amount ; cout<<"\n\tYour new available Balanced Amount is Rs."<>amount; if(amount>accountBalance||amount>20000)//Limit set at Rs.20000 maximum { system("cls"); cout<<"\n\tInsufficient Available Balance in your account.\n\n"<>access; switch(access) { case 1://pin to access account system("cls"); int i, pin; cout<<"\n\nEnter Your Acc Pin Access Number! [Only one attempt is allowed]\n\n"<>pin; system("cls"); if(pin==12345) { system("cls"); do { system("cls"); cout << "\t\tEnter [1] To Deposit Cash" << endl; cout << "\t\tEnter [2] To Withdraw Cash" << endl; cout << "\t\tEnter [0] to Exit ATM" << endl << endl; cout << "\tPLEASE ENTER A SELECTION AND PRESS RETURN KEY: \n\n"; cin>>e; switch(e) { case 1: p.deposit(); break; case 2: p.withdraw(); break; case 0: p.accountExit(); break; default:cout<<"Please Enter the Correct Number Choice"<

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

I need complete explanation of c++ code line by line. Need Explanation of all lines of code what is happening in this code where the data is stored.? 

Code

#include <iostream>
#include <iomanip>
#include <time.h>
#include <fstream>
#include <conio.h>
#include <string.h>
#include <stdlib.h>

using namespace std;

class Bank
{
public:
};
class ATMAccountHolders:public Bank
{
string accountHolders;
string accountHoldersAddress, branch;
int accountNumber;
double startBalance;
double accountBalance;
double amount;
int count;

public:
void deposit();
void withdraw();
void accountExit();

ATMAccountHolders()
{
accountNumber = 7787;
accountHolders = " Ammad Naseer";
accountHoldersAddress = " House no.112";
startBalance = 6000.00;
accountBalance = 6000.00;
branch = " Islamabad";
amount = 20000;
}
};

void ATMAccountHolders::deposit()
{
system("cls");

cout<<" ATM ACCOUNT DEPOSIT SYSTEM ";

cout<<"\n\nThe Names of the Account Holders are :"<<accountHolders<<"\n\n";
cout<<"\tThe Account Holders' address is :"<<accountHoldersAddress<<"\n\n";
cout<<"\tThe Branch location is :"<<branch<<"\n\n";
cout<<"\tAccount number :"<<accountNumber<<"\n\n";

cout<<"\tStarting account balance :Rs. "<<startBalance<<"\n\n";
cout<<"\tPresent available balance :Rs. "<<accountBalance<<"\n\n";
cout<<"\tEnter the Amount to be Deposited:Rs.";

double amount;
cin>>amount;
accountBalance=startBalance+amount ;
cout<<"\n\tYour new available Balanced Amount is Rs."<<accountBalance<<endl ;
cout<<"\n\t\t\tThank You!\n\n"<<endl;
cout<<"Press any key to Return to the Main Menu\n\n";
system("PAUSE");
}
//==================================================================================================
void ATMAccountHolders::withdraw()//Withdrawal Transactions
{
system("cls");

cout<<"\n\nThe Names of the Account Holders are :"<<accountHolders<<"\n\n";
cout<<"\tThe Account Holders' address is :"<<accountHoldersAddress<<"\n\n";
cout<<"\tThe Branch location is :"<<branch<<"\n\n";
cout<<"\tAccount number :"<<accountNumber<<"\n\n";

cout<<"\tPresent available balance :Rs."<<accountBalance<<"\n\n";
cout<<"\tEnter the Amount to be Withdrawn Rs.";

double amount;
cin>>amount;

if(amount>accountBalance||amount>20000)//Limit set at Rs.20000 maximum
{
system("cls");

cout<<"\n\tInsufficient Available Balance in your account.\n\n"<<endl;
cout<<"\t\t\tSorry !!\n"<<endl;
system("PAUSE");
}
else

double b;
accountBalance=accountBalance-amount ;

cout<<"\n\nThe Names of the Account Holders are :"<<accountHolders<<"\n\n";
cout<<"\tThe Account Holders' address is :"<<accountHoldersAddress<<"\n\n";
cout<<"\tThe Branch location is :"<<branch<<"\n\n";
cout<<"\tAccount number :"<<accountNumber<<"\n\n";
cout<<"Your new available Balanced Amount is Rs."<<accountBalance<<endl ;
cout<<"Press any key to Return to the Main Menu\n\n";
system("PAUSE");

}

void ATMAccountHolders::accountExit()
{
system("cls");



cout<<"\n\n\t\t BROUGHT TO YOU BY AMMAD NASEER (SP20-BCS-156) \n\n";

system("PAUSE");
exit(1);
}

int main()
{
int e;
ATMAccountHolders p;

system("cls");

system ("Color 1f");
cout << "\t\tCurrent date : ";
time_t now;
time(&now);

printf("%s\n", ctime(&now));;
//Give space for the function of date and time
cout<<"\t\t\t--------------------\n"<<endl;



cout<<"\tPress 1 and Then Press Enter to Access Your Account Via Pin Number\n\n";
cout<<"\t\t\t\t\t OR \n\n";
cout<<"\tPress 0 and press Enter to get Help.\n\n";


int access;
cin>>access;
switch(access)
{
case 1://pin to access account
system("cls");
int i, pin;


cout<<"\n\nEnter Your Acc Pin Access Number! [Only one attempt is allowed]\n\n"<<endl;

cin>>pin;

system("cls");

if(pin==12345)

{
system("cls");

do
{

system("cls");

cout << "\t\tEnter [1] To Deposit Cash" << endl;
cout << "\t\tEnter [2] To Withdraw Cash" << endl;
cout << "\t\tEnter [0] to Exit ATM" << endl << endl;
cout << "\tPLEASE ENTER A SELECTION AND PRESS RETURN KEY: \n\n";


cin>>e;
switch(e)
{
case 1:
p.deposit();
break;
case 2:
p.withdraw();
break;
case 0:
p.accountExit();
break;
default:cout<<"Please Enter the Correct Number Choice"<<endl;
}
}while(e!=0);

break;
}

else
{
system("cls");

cout<<"\nYou had made your attempt which failed!!! No More attempts allowed!! Sorry!!\n\n";


system("PAUSE");
exit (1);
}
case 0://pin to access account
system("cls");

cout<<"\n\n\t\tBank representative for assistance during bank opening hours\n\n";
cout<<"\t\tThanks for, your choice today!!\n\n";

system ("PAUSE");
exit(1);
break;
}

system("PAUSE");
return 0;

}

 

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education