OOP REPORT
OOP REPORT
Micro-Project
On
1
CERTIFICATE
2
1.0 Micro Project Proposal
“Bank Application Programing”
3
1.4 Action Plan
Detail of the Plan Plan Performed
Sr.
activity start finis by students
No
ed hed
1 Planning of project Avani,
Shravani
2 Desing the Algorithm Shravani
Patil
3 Building the Programe Avani,
Siddhant
4 Preparing Report Rashi
5 Submission of All members
project
Sr. Name of
No. Resources Specifications Quantity Remark
/ Material
1. Internet Google 1
2 Textbook Industrial 1
Hydraulics and
pneumatics
3 Software MS Office 1
word, Turbo
C
4
2.0 Micro Project Report
2.1) INTRODUCTION:-
i) WHAT IS OOP ?
Ans:
Objects: The basic units of OOP. An object is a self-contained unit that represents a real-
world entity.
Classes: The blueprints for creating objects. A class defines the properties (attributes) and
behaviors (methods) that its objects will have.
Inheritance: A mechanism in which one class can inherit properties and behaviors from
another class. This promotes the reuse of code.
Polymorphism: The ability of different classes to be treated as instances of the same class
through inheritance. This is typically achieved through the use of function overriding or
operator overloading.
Encapsulation: The bundling of data (attributes) and methods that operate on that data into a
single unit or class. It also restricts direct access to some of an object's components, which is a
means of preventing unintended interference and misuse of data.
Maintainability: Due to its modular structure, OOP code is often easier to maintain.
5
Many popular programming languages, such as Java, C++, Python, and C#, support OOP,
making it a widely-adopted paradigm in software development.
Sequential Execution: Procedural programs typically follow a linear execution model, where
instructions are executed one after the other, starting from the beginning of the program.
Data Flow: Data is often passed between procedures as arguments, and global variables may
be used to share data between different parts of the program.
Limited Code Reusability: While procedures can be reused in different parts of the program,
procedural programming does not provide the same level of code reusability and modularity as
some other paradigms, such as object-oriented programming.
Example Languages: Languages such as C, Pascal, and Fortran are often associated with
procedural programming.
Procedural programming is well-suited for certain types of tasks and applications, especially
when the problem can be broken down into a series of discrete steps or when efficiency is a
primary concern. It is commonly used in scenarios like system programming, scripting, and
mathematical computation.
However, as software development has evolved, more complex applications have arisen,
leading to the development of other programming paradigms, such as Object-Oriented
Programming (OOP) and Functional Programming (FP), which provide additional tools and
abstractions for managing complexity and organizing code. Developers often choose the
programming paradigm that best matches the requirements of their specific project.
6
iii) MAIN DIFFERENCE BETWEEN OOP AND POP ?
Ans:
OOP: OOP focuses on organizing code around objects, which are instances of classes.
Objects encapsulate both data (attributes) and behaviors (methods). OOP promotes modeling
real-world entities and their interactions.
POP: POP organizes code around procedures or functions. It emphasizes a linear flow of
execution, where a program is constructed as a series of procedures that perform specific
tasks.
Core Concepts:
POP: The central concept in POP is procedures or functions. These procedures define a series
of steps or actions to be executed in a particular order.
Data Management:
OOP: OOP promotes data encapsulation and access control through methods. Data is
typically encapsulated within objects, and access to this data is controlled.
POP: POP often relies on global variables for data management, and data is commonly passed
between procedures as arguments.
Code Reusability:
OOP: OOP provides a higher level of code reusability through the use of classes and
inheritance. Objects and their methods can often be reused in different parts of the program.
POP: While procedures can be reused, POP typically provides less inherent code reusability
compared to OOP.
Use Cases:
OOP: OOP is well-suited for modeling complex systems and relationships between objects. It
is commonly used in applications like graphical user interfaces (GUIs), video games, and
simulations.
7
POP: POP is suitable for simpler programs or scenarios where a linear sequence of steps is
sufficient. It is often used in embedded systems, system programming, and scripting.
Examples:
OOP: Programming languages that support OOP include Java, C++, Python, C#, and Ruby.
POP: Languages like C, Pascal, and Fortran are often associated with procedural
programming.
Ans:
C++ is a powerful and versatile programming language that builds upon the foundation of the
C programming language while introducing additional features and concepts, particularly in
the realm of object-oriented programming (OOP). Here are some key details about C++:
History:
• C++ was developed by Bjarne Stroustrup at Bell Labs in the early 1980s.
• It was initially created as an extension of the C programming language, which is a
procedural language known for its efficiency and low-level programming capabilities.
• The name "C++" reflects its evolution from C, with "++" being a programming
increment operator.
Multi-Paradigm Language:
• C++ is known for its robust support of OOP concepts, including classes, objects,
inheritance, polymorphism, encapsulation, and abstraction.
• Classes are used to define blueprints for creating objects, and objects encapsulate both
data (attributes) and behaviors (methods).
• Inheritance allows for the creation of hierarchies of classes, where derived classes
inherit properties and behaviors from base classes.
• C++ includes the Standard Template Library (STL), which provides a rich set of
generic data structures (e.g., vectors, queues, maps) and algorithms (e.g., sorting,
searching).
• The STL simplifies common programming tasks and promotes code reusability.
8
Efficiency:
• C++ is known for its performance and efficiency, making it suitable for systems
programming, game development, and other applications where low-level control over
hardware resources is important.
• It allows for direct memory management through pointers, which provides fine-grained
control but requires careful handling to avoid memory-related errors.
Popular Applications:
• C++ is widely used in various domains, including game development (e.g., Unreal
Engine), system software (e.g., operating systems), embedded systems, scientific
computing, and high-performance computing.
Standardization:
Cross-Platform:
C++ has a large and active developer community, and there are numerous online
resources, forums, and books available for learning and mastering the language.
9
3.0 Implementation:
3.1) Algorithm for Banking System:
1. Initialize necessary variables and data structures.
2. Create a class named 'bank' with attributes: acno, holder, balance, phoneno, and password.
Include member functions for various operations (inputdata, Display, Deposite, Withdraw,
Search).
3. Create an array of 'bank' objects to store account information. Initialize it to hold account
data.
4. Prompt the user to input the number of accounts (n). Ensure n is less than or equal to the
maximum allowed accounts (e.g., 10).
a. Call the 'inputdata' member function to input account details and initialize the account
objects.
- Deposit
- Withdraw
- Change Password
- Exit
10
ii. Based on the user's choice, perform the corresponding operation using switch-case
statements and functions.
- Deposit
- Withdraw
- Change Password
- Exit
b. Based on the user's choice, perform the corresponding operation using switch-case
statements and functions.
c. For operations requiring password verification, prompt for and verify the password
against the stored password.
c. If the account is found, proceed with the operation; otherwise, display an error message.
10. Implement error handling and validation as needed (e.g., checking for minimum account
balance, maximum account limit, incorrect inputs).
11. Repeat the menu-based operations in an infinite loop until the user chooses to exit.
12. Properly manage the array of 'bank' objects to reflect changes made during operations
(e.g., account balances, account data).
13. Implement an option to change the management password and verify it when necessary.
14. Continuously display a menu for the user to choose different operations until the user
decides to exit the program.
15. Implement proper program termination when the user chooses to exit.
16. Ensure data persistence (optional) by saving and loading account data to/from files.
17. Test the program with various scenarios to validate its functionality and correctness.
18. Add comments and documentation to the code for clarity and maintainability.
11
19. Compile and run the program to verify its functionality.
20. Handle unexpected errors gracefully and provide informative error messages to the user.
3.2 ) Program :
#include <iostream>
#include <stdlib.h>
#include <cstring>
using namespace std;
class Bank {
public:
int acno;
char holder[20];
int balance;
char phoneno[20];
char password[20];
Bank() {
balance = 200;
}
void inputdata() {
void Display() {
cout << "\n-------------------------------------------" << endl;
cout << "Account Number: " << acno << endl;
cout << "Name: " << holder << endl;
cout << "Balance: $" << balance << endl;
cout << "Phone Number: " << phoneno << endl;
cout << "-------------------------------------------\n" << endl;
}
12
void Deposit() {
system("cls");
cout << "Enter the amount to deposit: $";
int depositAmount;
cin >> depositAmount;
balance += depositAmount;
cout << "Deposit Successful!" << endl;
cout << "Updated Balance: $" << balance << endl;
}
void Withdraw() {
system("cls");
cout << "Enter the amount to withdraw: $";
int withdrawAmount;
cin >> withdrawAmount;
int main() {
int n;
int i = 0;
int choice;
int accNumber;
int ele = 0;
13
char password[20];
int Managepass = 23;
int Role;
char phone[20];
Bank accounts[10];
switch (Role) {
case 1:
cout << "Enter The Management password: ";
cin >> Managepass;
if (Managepass == 23) {
while (1) {
cout << "\n-------------------------------------------" <<
endl;
cout << "Choose an Operation:" << endl;
cout << "1) Edit Account Data\n2) Get Account Data\n3)
Deposit\n4) Withdraw\n5) Display All Accounts\n6) Add an Account\n7) Change
Password\n8) Exit" << endl;
cout << "-------------------------------------------\n" <<
endl;
cin >> choice;
switch (choice) {
case 1:
cout << "Enter Account Number: ";
cin >> accNumber;
if (ele) {
cout << "What would you like to edit?" <<
endl;
14
cout << "1) Holder Name\n2) Account
Password\n3) Account Holder Phone Number\nChoice: ";
int editChoice;
cin >> editChoice;
switch (editChoice) {
case 1:
cout << "Enter New Holder Name: ";
cin >> accounts[i].holder;
cout << "Account Data Updated
Successfully!" << endl;
break;
case 2:
cout << "Enter New Password: ";
cin >> accounts[i].password;
cout << "Account Data Updated
Successfully!" << endl;
break;
case 3:
cout << "Enter New Phone Number: ";
cin >> accounts[i].phoneno;
cout << "Account Data Updated
Successfully!" << endl;
break;
default:
cout << "Invalid Operation" << endl;
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
break;
case 2:
cout << "Enter Account Number: ";
cin >> accNumber;
15
if (!ele) {
cout << "Account doesn't exist" << endl;
break;
}
}
break;
case 3:
cout << "Enter Account Number for Deposit: ";
cin >> accNumber;
if (ele) {
cout << "Enter Your Password: ";
cin >> password;
if (accounts[i].Authenticate(password)) {
accounts[i].Deposit();
} else {
cout << "Incorrect Password" << endl;
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
break;
case 4:
cout << "Enter Account Number for Withdrawal: ";
cin >> accNumber;
if (ele) {
cout << "Enter Your Password: ";
cin >> password;
if (accounts[i].Authenticate(password)) {
16
accounts[i].Withdraw();
} else {
cout << "Incorrect Password" << endl;
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
break;
case 5:
system("cls");
if (n == 0) {
cout << "No accounts to display." << endl;
} else {
for (int i = 0; i < n; i++) {
accounts[i].Display();
cout << "\n";
}
}
break;
case 6:
if (n < 10) {
accounts[n].inputdata();
n++;
cout << "Account added successfully!" << endl;
} else {
cout << "Maximum number of accounts reached
(10)." << endl;
}
break;
case 7:
cout << "Enter Account Number for Password Change: ";
cin >> accNumber;
if (ele) {
cout << "Enter Your Password: ";
17
cin >> password;
if (accounts[i].Authenticate(password)) {
cout << "Enter the New Password: ";
cin >> accounts[i].password;
cout << "Password Changed Successfully!"
<< endl;
} else {
cout << "Incorrect Password" << endl;
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
break;
case 8:
return 0;
default:
cout << "Invalid Option" << endl;
}
}
} else {
cout << "Incorrect Management Password" << endl;
}
break;
case 2:
cout << "Opening Customer Interface" << endl;
while (1) {
cout << "\n-------------------------------------------" << endl;
cout << "Choose an Operation:" << endl;
cout << "1) Get Account Data\n2) Deposit\n3) Withdraw\n4) Change
Password\n5) Exit" << endl;
cout << "-------------------------------------------\n" << endl;
cin >> choice;
switch (choice) {
case 1:
cout << "Enter Account Number: ";
cin >> accNumber;
18
for (i = 0; i < n; i++) {
ele = accounts[i].Search(accNumber);
if (ele) {
cout << "Enter Your Password: ";
cin >> password;
if (accounts[i].Authenticate(password)) {
accounts[i].Display();
} else {
cout << "Incorrect Password" << endl;
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
break;
case 2:
cout << "Enter Account Number for Deposit: ";
cin >> accNumber;
if (ele) {
cout << "Enter Your Password: ";
cin >> password;
if (accounts[i].Authenticate(password)) {
accounts[i].Deposit();
} else {
cout << "Incorrect Password" << endl;
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
19
break;
case 3:
cout << "Enter Account Number for Withdrawal: ";
cin >> accNumber;
if (ele) {
cout << "Enter Your Password: ";
cin >> password;
if (accounts[i].Authenticate(password)) {
accounts[i].Withdraw();
} else {
cout << "Incorrect Password" << endl;
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
break;
case 4:
cout << "Enter Account Number for Password Change: ";
cin >> accNumber;
if (ele) {
cout << "Enter Your Phone Number: ";
cin >> phone;
if (strcmp(phone, accounts[i].phoneno) == 0) {
cout << "Enter the New Password: ";
cin >> accounts[i].password;
cout << "Password Changed Successfully!" <<
endl;
} else {
cout << "Incorrect Phone Number" << endl;
20
}
break;
}
}
if (!ele) {
cout << "Account doesn't exist" << endl;
}
break;
case 5:
return 0;
default:
cout << "Invalid Option" << endl;
}
}
break;
default:
cout << "Invalid Role" << endl;
break;
}
}
• This class represents a bank account with attributes like account number ( acno),
account holder name (holder), account balance (balance), phone number
(phoneno), and password (password).
The constructor initializes the balance to 200.
2. inputdata Function:
• This function is used to input account details such as account number, holder
name, phone number, and password.
3. Display Function:
21
• This function displays the account details, including account number, holder
name, balance, and phone number.
4. Deposite Function:
• This function allows users to deposit money into their accounts by inputting the
deposit amount and updating the account balance accordingly.
5. Withdraw Function:
• This function allows users to withdraw money from their accounts by inputting
the withdrawal amount. It includes checks for a minimum balance of 200 and
displays a warning if the minimum balance is exceeded.
6. Search Function:
• This function searches for an account based on the provided account number ( a).
If found, it displays the account details using the Display function and returns 1.
Otherwise, it returns 0.
7. main Function:
• The main function is where the program starts execution.
• It declares variables for managing accounts, roles, passwords, and user input.
• It allows the user to input the number of accounts to manage (limited to 10).
• It initializes an array A of bank objects to store account data.
• It collects account details using the inputdata function.
• It prompts the user to choose their role as a manager or customer ( Role).
• In the manager role:
• The program verifies the manager password ( manpas) before allowing
access.
• The user can perform various operations such as editing account data,
depositing, withdrawing, adding accounts, changing passwords, and
displaying all accounts.
• Managers can exit the manager interface using option 8.
• In the customer role:
• The user is prompted for their account number and password for
authentication.
• Customers can view their account details, deposit, withdraw, change
passwords, and exit the customer interface.
• The program continues to run until the user chooses to exit by returning 0.
The program provides a simple banking management system with options for both
managers and customers to interact with accounts, perform transactions, and manage
account information.
22
4.0) Advantages and disadvantages of This Program:
4.1) Advantages:
A bank management program, like the one you've created in your C++ code, offers
several advantages for both banks and their customers. Here are some of the key advantages:
1) Efficient Customer Service: Bank employees can efficiently manage customer accounts,
process transactions, and provide quick responses to customer inquiries, leading to
improved customer service.
2) Automated Transactions: Automation of routine transactions such as deposits,
withdrawals, and balance inquiries reduces the need for manual processing, minimizing
errors and speeding up transactions.
3) Account Management: The program allows for easy tracking and management of customer
accounts, including account details, balances, and transaction history.
4) Security: By implementing user authentication and password protection, the program helps
secure customer accounts and sensitive financial information.
5) Role-Based Access Control: The program distinguishes between manager and customer
roles, ensuring that only authorized personnel can access and perform certain operations.
6) Data Integrity: With proper data validation and error handling, the program helps maintain
data integrity by preventing invalid or erroneous data from being entered.
7) Accessibility: Customers can access their account information, make transactions, and
change their passwords conveniently through the customer interface.
8) Account Additions: Bank managers can easily add new customer accounts, ensuring
scalability as the number of customers grows.
9) Password Changes: Customers can change their passwords, enhancing account security.
10) Account Customization: The program allows for the customization of account holder
names and phone numbers, making it more user-friendly.
11) Minimum Balance Alerts: The program provides warnings when account balances fall
below a certain threshold, helping customers avoid overdrafts and fees.
12) Managerial Control: Bank managers can oversee all customer accounts, make changes
when necessary, and monitor overall bank operations.
13) Record Keeping: Transaction history and account details are stored electronically,
simplifying record-keeping and auditing processes.
14) Convenience: Customers can perform banking operations from the comfort of their homes
or offices, reducing the need to visit physical bank branches.
15) User-Friendly Interface: The program offers an intuitive user interface for both customers
and bank managers, making it easy to navigate and use.
16) Time Efficiency: Routine tasks are automated, allowing bank employees to focus on more
complex and strategic aspects of their roles.
17) Scalability: The program can handle a growing number of customer accounts without
significant increases in administrative overhead.
18) Cost Reduction: Automation and efficiency improvements can lead to cost savings for the
bank.
23
19) Data Analysis: Over time, the program can accumulate valuable data that can be used for
analytics and decision-making to improve services and profitability.
4.2) DisAdvantages:
24
7. Lack of Encapsulation: The program's data members (e.g., `acno`,
`holder`, `balance`, `phoneno`, and `password`) are public, violating the
principle of encapsulation. They should be private with accessors and
mutators (getters and setters) to control access.
9. Fixed Initial Balance: All accounts are initialized with a fixed balance
of 200, which is unrealistic for a real bank management system.
13. No Clear Exit Mechanism: Exiting the program from the manager or
customer loop can be unclear and may require multiple iterations of the
main menu.
25
15. Lack of User Documentation: There is no user documentation or
help system to guide users through the program's functionality.
18. No Error Logging: The program doesn't log errors or events, which
can make it challenging to diagnose and resolve issues.
The end……
26