You are to design a program that will serve as a database for keeping track of a
ID: 3647017 • Letter: Y
Question
You are to design a program that will serve as a database for keeping track of a studentExplanation / Answer
#include #include #include using namespace std; class Account { public: Account(); Account (double bal); void deposit(double amount); void withdraw(double amount); double get_balance() const; void add_interest(double rate); private: double balance; }; Account::Account() { } Account::Account(double bal) { balance = bal; } void Account::deposit(double amount) { balance +=amount; } void Account::withdraw (double amount) { if ( balance >= amount) balance -= amount; else balance -= 5.00; // Charge a $5.00 penalty fee if attempting to withdraw more than balance. } double Account::get_balance()const { return balance; } void Account::add_interest(double rate) { balance *= ( 1 + (rate/100.0)); } int main() { cout > initial_investment; cout > rate_in_percentage; double monthly_rate = rate_in_percentage/100.0/12.0; double final_amount = 2 * initial_investment; Account my_account(initial_investment); int months = 1; while ( my_account.get_balance()Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.