Professional Documents
Culture Documents
ICP Midterm Project
ICP Midterm Project
Project Description:
You are tasked with implementing a simplified banking system that models the behavior of bank accounts. This
project will test your knowledge and skills in various C++ concepts, including copy constructors, multiple inheritance,
operator overloading, range-based loops, standard template library (STL), and virtual functions. You will also be
required to design and implement a class hierarchy for different types of bank accounts.
Project Requirements:
1- Class Hierarchy:
➢ Create a base class called BankAccount with the following attributes:
• std::string accountNumber
• std::string accountHolderName
• double balance
➢ Implement the following member functions for the BankAccount class:
• A default constructor.
• A parameterized constructor that takes accountNumber, accountHolderName, and balance as
parameters.
• A copy constructor.
• A virtual function void deposit(double amount) that adds amount to the balance.
• A virtual function void withdraw(double amount) that subtracts amount from the balance.
• A virtual function void display() const that displays the account information (account number,
account holder name, and balance).
2- Derived Classes:
• Create two derived classes, SavingsAccount and CheckingAccount, both inheriting from
BankAccount.
• SavingsAccount should have an additional attribute double interestRate and a member function
void addInterest() that increases the balance by the interest rate times the current balance.
• CheckingAccount should have an additional attribute double overdraftLimit and override the
withdraw function to allow for overdrafts up to the overdraft limit.
3- Operator Overloading:
Implement the + operator overloading for BankAccount objects to combine the balances of two accounts
and return a new BankAccount object.
4- STL Usage:
Use an STL container (e.g., std::vector) to store and manage a collection of BankAccount objects.
5- Range-Based Loops:
Use range-based loops to iterate through and display the information of all the accounts in your container.
CS313 INTERMEDIATE COMPUTER PROGRAMMING
Spring 2024 – MIDTERM EXAM (PROJECT ASSESMENT)
Rubric:
Criterion Points
Class Hierarchy
BankAccount class with attributes 10
Constructors and copy constructor 10
Virtual functions and display method 10
Derived Classes
SavingsAccount class and attributes 10
CheckingAccount class and attributes 10
addInterest and withdraw overrides 10
Operator Overloading
+ operator overloading 10
STL Usage
Proper use of STL container 10
Range-Based Loops
Iteration and display of accounts 10
Code Quality and Documentation 10
Total Points 100
Submission:
Important Notes:
• Plagiarism or unauthorized collaboration with others will result in a grade of zero for the project.
• Late submissions will be subject to a penalty unless prior arrangements are made.
• Make sure your code is well-organized, readable, and follows C++ best practices.