Question: #include #include using namespace std; class account { private: long accNum = 0; double balance = 0; public: account() {} virtual int setRate(double f) {

#include #include using namespace std; class account { private: long accNum = 0; double balance = 0; public: account() {} virtual int setRate(double f) { return 0; } virtual double computeIntr(int years) { return 0; } virtual long getAcct() { return accNum; } double getBalance() { return balance; cout << "inside balance" << balance << " yo "; } int setAcct(long acct) { try { if (acct >= 0) { accNum = +acct; } else { throw "account number cant be negative!"; } } catch (string x) { cout << x << endl; return -1; } } int setBalance(double balanc) { try { if (balanc >= 0) { balance = +balanc; } else { throw "balance Cannot be negative!"; } } catch (string g) { cout << g << endl; return -1; } return 0; } account(long acct, double bal) { try { if (bal >= 0) { balance = bal; } else { throw "balance Cannot be negative!"; } } catch (string g) { cout << g << endl; } try { if (acct >= 0) { accNum = acct; } else { throw "account number cant be negative!"; } } catch (string x) { cout << x << endl; } } virtual string toString() { string Balance = to_string(getBalance()); string Acc = to_string(getAcct()); cout << "Account Number " << Acc << ",has a balance of " << Balance; return Balance; } virtual double computeintr(int years) { return 0; } }; class checking :public account { private: int minIntrBalance = 0; int intRate = 0; public: checking(){} virtual string toString() { string Balance = to_string(getBalance()); string Acc = to_string(getAcct()); cout << "Account Number " << Acc << ",has a balance of " << Balance; return Balance; } int getMinIntrBalance() { return minIntrBalance; } int setMinIntrBalance(int lowestBalance) { try { if (lowestBalance >= 0) { minIntrBalance = lowestBalance; } else { throw "the minimum balance cant be less than 0!"; return -1; } } catch (string k) { cout << k << endl; } } int getRate() { return intRate; } int setRate(double rate) { try { if (rate >= 0) { intRate = rate; } else { throw string("rate cannot be negative!"); } } catch (string k) { cout << k << endl; return -1; } } double computeIntr(int years) { float temp = (float)intRate*.01; float tempb = getBalance(); minIntrBalance = getBalance() + tempb*temp*years; return minIntrBalance; } checking(long acc, double bal) { account a(acc, bal); setBalance(bal); setAcct(acc); } }; class saving :public account { private: double intRate = 0; public: saving(){} double getRate() { return intRate; } int setRate(double rate) { try { if (rate >= 0) { intRate = rate; } else throw string("interest rate cannot be negative!"); } catch (string x) { cout << x << endl; return -1; } } virtual string toString() { string Balance = to_string(getBalance()); string Acc = to_string(getAcct()); cout << "Account Number " << Acc << ",has a balance of " << Balance; return Balance; } double computeIntr(int years) { float minIntrBalance = 0; float temp = (float)intRate*.01; float tempb = getBalance(); minIntrBalance = getBalance() + tempb*temp*years; return minIntrBalance; } saving(long acc, double bal) { account a(acc, bal); setBalance(bal); setAcct(acc); } }; #define BALANCE 1000 int main() { int years = 0; double interestrate = 0; int accountnumber = 0; const int numberofchecking = 5; const int numofsaving = 5; checking c; checking checkingaccount[numberofchecking]; saving savings[numofsaving]; account* ac[100]; char choice; for (int i = 0; i < numberofchecking; i++) { ac[i] = &checkingaccount[i]; ac[i]->setAcct(100 + i); ac[i]->setBalance(BALANCE + (10 * (ac[i]->getAcct()))); } for (int i = 0; i < numofsaving; i++) { ac[numberofchecking + i] = &savings[i]; ac[numberofchecking + i]->setAcct(200 + i); ac[numberofchecking + i]->setBalance(BALANCE + (10 * (ac[numberofchecking + i]->getAcct()))); ac[numberofchecking + i]->setRate(.03); } for (int z = 0; z < 1;) { cout << "Welcome to The University of Michigan's Banking Program" << endl; cout << "Enter an account number" << endl; cin >> accountnumber; for (int i = 0; i < 1;) { while (!((accountnumber <= 105 && accountnumber >= 100) || (accountnumber <= 205 && accountnumber >= 200))) { cout << "accountnumber number must be between 100 and 105 or inbetween 200 and 205" << endl; cin >> accountnumber; } if ((accountnumber % 200) >= 0 && accountnumber % 200 <= 5) { cout << "a to add an account r to remove account g to get account b to set balance i to set interest d to display balance c for interest displaying q to quit processing this account" << endl; cin >> choice; if (choice == 'r' || choice == 'R') { cout << "account removed!" << endl; i++; } if (choice == 'q' || choice == 'Q') { i++; z++ ; } if (choice == 'g' || choice == 'G') { cout <<"account#: "<< ac[numberofchecking + accountnumber % 200]->getAcct() << endl; } if (choice == '0') { i++; } if (choice == 'd' || choice == 'D') { ac[numberofchecking + accountnumber % 200]->toString(); } if (choice == 'i' || choice == 'I') { cout << "What would you like to set the interest rate to?" << endl; cin >> interestrate; ac[numberofchecking + accountnumber % 200]->setRate(interestrate); while (ac[numberofchecking + accountnumber % 200]->setRate(interestrate) == -1) { cout << "Enter again" << endl; cin >> interestrate; } ac[numberofchecking + accountnumber % 200]->setRate(interestrate); } if (choice == 'c' || choice == 'C') { cout << "How many Years would you like to set your interest rate calculation?" << endl; cin >> years; while (years < 0) { cout << "Years cannot be negative! reenter please." << endl; cin >> years; } cout << "your interest rate compounded is: " << ac[numberofchecking + accountnumber % 200]->computeIntr(years); } if (choice == 'b' || choice == 'B') { int bal=0; cout << "please input a new balance" << endl; cin >> bal; while (bal < 0) { cout << "balance Cannot be negative! please reenter" << endl; cin >> bal; } ac[numberofchecking + accountnumber % 200]->setBalance(bal); } if (choice == 'a' || choice == 'A') { int aacc; cout << "enter a new bank account number" << endl; cin >> aacc; cout << "account " << aacc << " has been created" << endl; } } else if ((accountnumber % 100) >= 0 && (accountnumber % 100) <= 5) { //cout <<"Your Balance is: "<< ac[accountnumber % 100]->getBalance(); int interestrate = 0; cout << "Your Balance is: " << ac[accountnumber % 100]->getBalance(); cout << "What would you like to set the interest rate to?" << endl; cin >> interestrate; ac[accountnumber % 100]->setRate(interestrate); while (ac[accountnumber % 100]->setRate(interestrate) == -1) { cout << "Enter again" << endl; cin >> interestrate; } ac[accountnumber % 100]->setRate(interestrate); int years = 0; cout << "How many Years would you like to set your interest rate calculation?" << endl; cin >> years; while (years < 0) { cout << "Years cannot be negative! reenter please." << endl; cin >> years; } cout << "your interest rate compounded is: " << ac[accountnumber % 100]->computeIntr(years); } } } system("pause"); return 0; }

turn this into pseudocode please

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!