Upgrade the BankAccount class to store accounts in a vector called accountsVector. Create a static variable called count that stores the number of BankAccount objects created. Read data as before from the same file BankData.dat and create objects accordingly and store them in the vector. You may need to add or modify methods in your BankAccount class, as well as helper methods in your main class. Extend the BankAccount class to include a static int variable called count that stores the number of objects created. Note you will need to use the scope resolution operator :: to access this variable. BankAccount -string accountName // First and Last name of Account holder -int accountId // secret social security number -int accountNumber // integer -double accountBalance // current balance amount + static int count // number of objects created ** + BankAccount() //default constructor that sets name to "", account number to 0 and balance to 0 +BankAccount(string accountName,int id, int accountNumber, double accountBalance) // regular constructor +getAccountBalance(): double // returns the balance +getAccountName: string // returns name +getAccountNumber: int +setAccountBalance(double amount) : void +equals(BankAccount other) : bool // returns true if this equals other. False otherwise ** +getCount(): int // returns count ** -getId():void +withdraw(double amount) : bool //deducts from balance and returns true if resulting balance is less than minimum balance +deposit(double amount): void //adds amount to balance. If amount is greater than rewards amount, calls // addReward method -addReward(double amount) void // adds rewards rate * amount to balance +toString(): String // return the account information as a string with three lines. "Account Name: " name "Account Number:" number "Account Balance:" balance Create the specification file BankAccountHeader.h which meets the above specifications Create the implementation file BankAccount.cpp which implements the BankAccount class as given in the UML diagram above. The class will have member variables( attributes/data) and instance methods(behaviours/functions that initialize, access and process data) make a driver class to do the following: Read data from the given file txt and create and vector of BankAccount Objects The order in the file is first name, last name, id, account number, balance. Note that account name consists of both first and last name Print the vector (without secret id) as in Homework3. Find the account with largest balance and print it Find the account with the smallest balance and print it. Print the number of objects using static count variable as well as vector size method Determine if there are duplicate accounts in the vector If there are then erase the account from the vector. Note the difference in the method return value and the procedure to the equals method in Homework 3. See how array deletion is different from vector deletion. If there are duplications then reprint the vector as before Again, print the number of objects using static count variable as well as vector size method See if there is a difference. Insert three new accounts at position 3, 5 and 7 of the vector. Remember your vector will keep increasing in size as you add! The three accounts are: Name : "Amy Machado" Id: 387623 Account Number : 1244 Balance: 1023.67 Name: "Tak Phen" Id: 981243 Account Number: 1262 Balance: 6423.03 Name: "Celia Beatle" Id: 465281 Account Number: 1276 Balance: 3.56 Please note that you may use a simple linear search based on bank balance as search key in this assignment For now, you may declare the function prototype at the beginning of the driver file, and the function definition at the bottom of the same file. We will separate the function definitions into another function header file when the number gets larger. BankData.txt: Matilda Patel 453456 1232 -4.00 Fernando Diaz 323468 1234 250.0 Vai vu 432657 1240 987.56 Howard Chen 234129 1236 194.56 Vai vu 432657 1240 -888987.56 Sugata Misra 987654 1238 10004.8 Fernando Diaz 323468 1234 8474.0 Lily Zhaou 786534 1242 001.98   THE OUTPUT SHOULD LOOK LIKE SCREENSHOT

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Upgrade the BankAccount class to store accounts in a vector called accountsVector. Create a static variable called count that stores the number of BankAccount objects created. Read data as before from the same file BankData.dat and create objects accordingly and store them in the vector. You may need to add or modify methods in your BankAccount class, as well as helper methods in your main class.

  1. Extend the BankAccount class to include a static int variable called count that stores the number of objects created.
  2. Note you will need to use the scope resolution operator :: to access this variable.

BankAccount
-string accountName // First and Last name of Account holder
-int accountId // secret social security number
-int accountNumber // integer
-double accountBalance // current balance amount
+ static int count // number of objects created **
+ BankAccount() //default constructor that sets name to "", account number to 0
and balance to 0
+BankAccount(string accountName,int id, int accountNumber, double accountBalance) //
regular constructor
+getAccountBalance(): double // returns the balance
+getAccountName: string // returns name
+getAccountNumber: int
+setAccountBalance(double amount) : void
+equals(BankAccount other) : bool // returns true if this equals other. False otherwise **
+getCount(): int // returns count **
-getId():void
+withdraw(double amount) : bool //deducts from balance and returns true if resulting balance
is less than minimum balance
+deposit(double amount): void //adds amount to balance. If amount is greater than rewards
amount, calls
// addReward method
-addReward(double amount) void // adds rewards rate * amount to balance
+toString(): String // return the account information as a string with three lines. "Account
Name: " name

"Account Number:" number

"Account Balance:" balance

  1. Create the specification file BankAccountHeader.h which meets the above specifications
  2. Create the implementation file BankAccount.cpp which implements the BankAccount class as given in the UML diagram above. The class will have member variables( attributes/data) and instance methods(behaviours/functions that initialize, access and process data)
  3. make a driver class to do the following:
    1. Read data from the given file txt and create and vector of BankAccount Objects

The order in the file is first name, last name, id, account number, balance. Note that account name consists of both first and last name

  1. Print the vector (without secret id) as in Homework3.
  2. Find the account with largest balance and print it
  3. Find the account with the smallest balance and print it.
  4. Print the number of objects using static count variable as well as vector size method
  5. Determine if there are duplicate accounts in the vector If there are then erase the account from the vector. Note the difference in the method return value and the procedure to the equals method in Homework 3. See how array deletion is different from vector deletion.
  6. If there are duplications then reprint the vector as before
  7. Again, print the number of objects using static count variable as well as vector size method

See if there is a difference.

  1. Insert three new accounts at position 3, 5 and 7 of the vector. Remember your vector will keep increasing in size as you add! The three accounts are:

Name : "Amy Machado" Id: 387623 Account Number : 1244 Balance: 1023.67

Name: "Tak Phen" Id: 981243 Account Number: 1262 Balance: 6423.03

Name: "Celia Beatle" Id: 465281 Account Number: 1276 Balance: 3.56

Please note that you may use a simple linear search based on bank balance as search key in this assignment

For now, you may declare the function prototype at the beginning of the driver file, and the function definition at the bottom of the same file. We will separate the function definitions into another function header file when the number gets larger.

BankData.txt:

Matilda Patel 453456 1232 -4.00
Fernando Diaz 323468 1234 250.0
Vai vu 432657 1240 987.56
Howard Chen 234129 1236 194.56
Vai vu 432657 1240 -888987.56
Sugata Misra 987654 1238 10004.8
Fernando Diaz 323468 1234 8474.0
Lily Zhaou 786534 1242 001.98

 

THE OUTPUT SHOULD LOOK LIKE SCREENSHOT  

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY