Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
OOP PPT Group H.pptx
1.
2. OOP Final Project
Project name:
ATM MACHINE
Presented to:
Mr. Muhammad Jabbar
Department of Computer Science
University of Gujrat
Hafiz Hayat Campus, Gujrat
4. Main Points
We have used such things in our project:
#include <bits/stdc++.h> header file
Classes
Inheritance
Constructor (default)
Function (Non-returning)
Do While Loop
If Else Statement
Switch Case Statement
Infinite Loop
5. ATM Machine
Header File #include <bits/stdc++.h>
This header file is used instead of all header files in C++
For Example:
#include <iostream>
#include <stdlib.h>
#include <cstring>
and many more header files.
6. ATM Machine
We made a class named Screen1 to show better output.
Then we made a class password for user
class Password{};
We use Do While to get and check password.
do{}
while (); }
};
We made child class ATM of Password parent class
with the process of Inheritance.
class Atm : public Password{};
7. ATM Machine
And we initialized balance with zero because balance cannot be
negative.
balance = 0;
We made Deposit() function to deposit amount.
void Deposit () ;
8. ATM Machine
We made withdraw() function to Withdraw
amount.
void withdraw();
We made transaction() function to
Transaction amount.
void transaction();
9. ATM Machine
We made PayBills function to pay bill
amount.
This paybills() function is to check
either user wants to pay bills or not.
void paybills ();
10. ATM Machine
sc is object of Screen1 class.
Screen1 sc;
pass is object of Password
class.
Password pass;
a is the object of Atm class.
Atm a;
11. ATM Machine
In Main Function we have made menu for user.
We also used for(;;) means infinite loop for repetition of Menu until user wants to exit it.
for (;;) // Ininite_loop
{ // Main_Menu
cout << "nEnter any option to be served!n" << endl;
cout << "Press [1] to Deposit Money" << endl;
cout << "Press [2] to Withdraw Money" << endl;
cout << "Press [3] to check Balance" << endl;
cout << "Press [4] to paybills" << endl;
cout << "Press [0] to Exitn" << endl;
cout << ">>";
cin >> choice;
12. ATM Machine
CLS (Clear Screen):
Purpose: Clears (erases) the screen. Erases all characters and graphics from the screen;
however, it does not change the currently-set screen attributes. to clear the screen of
everything but the command prompt and the cursor..
We have used this command to make our output better and easy to read.
system ("CLS"); //we use this command to clear our
screen for better output
13. ATM Machine
Switch Statement is used for choice.
switch (choice) {
case 1:{}
case 2:{}
case 3:{}
case 4:{}
case 0:// 0 means exit the program
exit (0);
default:// default statement
}