C++ Homework

Anonymous
timer Asked: Nov 19th, 2016

Question description


This class mimics holding bank data and info. The bank holds information regarding bank accounts.
The following two classes are used as shown. This class design must not be changed in any way. You should copy and paste this code before your main:

class Account
{
public:
char acctType;
double balance;
string status;

};

class BankHolder
{
public:
vector<Account> accts;
string bankerName;


};

Each BankHolder instance has the name of a person or business in the bankerName attribute. A BankHolder can have
any number of Account instances, but no account holder can have multiple accounts of any type (that is, no one will have two checking accounts)

acctType is a char indicated with the following key:
C=checking
S=savings
D=certificate of deposit
B=business account

Note that a BankHolder may have 0 - 3 accounts. Business account holders only have
1 account. Some BankHolders haven't completed their applications and will have 0
accounts at this time.

Data will be retrieved using the following function called bankers(). Note its return type. You are not responsible for understanding this code, only to copy and paste it as is.
You must only call this function only 1 time toward the beginning of your main() function.
You must #include <vector>.

Requirements:

Make a function that will accept a reference to the vector of BankHolder. The function will return the total balance of all accounts and will output a report that shows customers and their balances. The report format should be like this:

Person 1:
Checking account balance $xxx.xx

… (other accounts and balances they may have)
TOTAL BALANCE FOR Person 1:$xxxxx
------------------------------------------------------------
*Person 2:
*** Checking account balance $-xxx.xx ***
… (other accounts and balances they may have)
*TOTAL BALANCE FOR Person 2:$xxxxx
------------------------------------------------------------
-Person 3:
-Accounts are pending
------------------------------------------------------------
+Company 1

Business account balance:$xxx.xx
+TOTAL BALANCE FOR Company 1:-$xxx.xx

-----------------------------------------------------------

Note the following:

-Indentation is done using a tab.
-People with at least 1 negative balance (Person 2) should show an asterisk where shown. Further, surround the particular account with 3 asterisks as shown. Accounts not having a negative balance should be shown with no stars.
-People that have no accounts (Person 3) should show a minus sign where shown.
-Businesses will always have just 1 account marked with the 'B' (Company 1). Such accounts should have a plus regardless of whether the accounts have a negative balance or not.

-Ensure you include a documentation section that contains your name, date, and a description of your code.

Copy and paste the following function.


*/

vector<BankHolder> bankers(){
static vector<BankHolder> *lst=NULL;
if(lst == NULL){

lst = new vector<BankHolder>;


BankHolder *bhp = new BankHolder;
bhp->bankerName="Leigha Ekberg";

Account *a = new Account;
a->acctType='C';
a->balance=34.29;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Pearl Peshe";
a = new Account;
a->acctType='C';
a->balance=33.90;
bhp->accts.push_back(*a);
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="Kermit Yann";
a = new Account;
a->acctType='S';
a->balance=453.92;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Jim Tyson";
a = new Account;
a->acctType='C';
a->balance=-.47;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Joseph Steele";
a = new Account;
a->acctType='S';
a->balance=45780.02;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Mom and Pop, Inc.";
a = new Account;
a->acctType='B';
a->balance=230.05;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Jim McDonald";
a = new Account;
a->acctType='S';
a->balance=70.47;
bhp->accts.push_back(*a);
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="Matthew Marks";
a = new Account;
a->acctType='S';
a->balance=7234.97;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='C';
a->balance=4.71;
bhp->accts.push_back(*a);
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="UDC Foundation";
a = new Account;
a->acctType='B';
a->balance=89230.05;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Oscar Unger";
a = new Account;
a->acctType='C';
a->balance=10.05;
bhp->accts.push_back(*a);
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="Dante Dern";
a = new Account;
a->acctType='C';
a->balance=74.48;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='S';
a->balance=29.99;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Jill Martin";
a = new Account;
a->acctType='S';
a->balance=11.0;
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="Rea Haislip";
a = new Account;
a->acctType='S';
a->balance=3474.48;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='C';
a->balance=-2000.5;
bhp->accts.push_back(*a);
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="Cellphones R Us, LLC";
a = new Account;
a->acctType='B';
a->balance=2.57;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Harry Tanner";
a = new Account;
a->acctType='S';
a->balance=11.0;
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Ezekiel Bryant";
a = new Account;
a->acctType='D';
a->balance=911.6;
bhp->accts.push_back(*a);
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="Sonny Binghamton";
a = new Account;
a->acctType='S';
a->balance=8910.05;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Joe Richerson";
a = new Account;
a->acctType='S';
a->balance=2234.48;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='C';
a->balance=-234.5;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='D';
a->balance=500.34;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Felix Katz";
a = new Account;
a->acctType='S';
a->balance=8911.0;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Perry Mason, plc";
a = new Account;
a->acctType='S';
a->balance=11.0;
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Yummy Foods";
a = new Account;
a->acctType='B';
a->balance=212.97;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Joe College";
a = new Account;
a->acctType='S';
a->balance=2.48;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='C';
a->balance=2.5;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Sally Saver";
a = new Account;
a->acctType='D';
a->balance=971.01;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='S';
a->balance=91.81;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Karl Checker";
a = new Account;
a->acctType='C';
a->balance=4971.01;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='D';
a->balance=501.81;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

bhp = new BankHolder;
bhp->bankerName="Elaine Song";
a = new Account;
a->acctType='S';
a->balance=222.22;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='C';
a->balance=3334.34;
bhp->accts.push_back(*a);
a = new Account;
a->acctType='D';
a->balance=555.5;
bhp->accts.push_back(*a);
lst->push_back(*bhp);


bhp = new BankHolder;
bhp->bankerName="Gustavo Engelbrecht";
a = new Account;
a->acctType='B';
a->balance=1224.57;
bhp->accts.push_back(*a);
lst->push_back(*bhp);

}
return (*lst);
} //end of function


_________________________________

Do not use pointer in this HW

If you need me to send you any information or if you have any question plz let me know and I will email my prof

I know there are a lot of ways to solve this homework so plz let me know what are you trying to solve and I will send you the chapter from the book then you can do it is the way my professor looking for

Also i will add some of the ways we used in class if you need to do one of them do it exactly the same way.

I want you to do this HW %100 correct no mistakes. and no copy from the internet

thanks

Tutor Answer

(Top Tutor) Studypool Tutor
School: Purdue University
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors