Question: You are given a csv file ( Comma Separated Values ) with rows representing different bank accounts. You must read from these rows and store
You are given a csv file Comma Separated Values with rows representing different bank accounts. You
must read from these rows and store their information within a new object of its respective account
class. Then store that object within two maps. You will have store it as a pointer to ensure polymorphism
is maintained. The keys you will need to look up with are the account owners name and the accounts
ID You will code a functor that takes in the file path of the csv file.
To make things easier you should have the following maps in your functor:
Map : ID lookup map. This map will use the owners id as the key and the owners Bank Account
as a value BankAccount
Map : Name lookup map. This map will use the owners name as the key and the owners Bank
Account as a value BankAccount
The format of the file is as follows:
Type Name Amount ID
Derek Pearce
Ria Marshall
Ronan Walker
Eric Carr
etc...
The type number will be one of the ints or representing Checking, Savings, and Investment
accounts respectively
The options you will have to read cin and implement within your call operator:
Display all accounts
Display all of account type
Checking Accounts
Savings Accounts
Investment Accounts
Find account
Integer input for ID search use stoi!
String input for name search HAS TO BE FULL NAME
Not Found
Additional Notes
IMPORTANT You are expected to use CLI to get the file path from the main and pass it
to the functor. The program will be called in the following format:
mainout pathtoaccountscsv
We are using stdin aka cin for option selection. HOWEVER, note that cin name is NOT
the same as getlinecin name this important for when the input has spaces!
Because this part requires you to create new variables and store their pointers in maps, we are
working with dynamic memory. As such you are expected to delete the pointers also!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
