Question
Investment: This is the base abstract class with a unique account number, total investment value, an annual interest rate and the pure virtual functions: liquidate(amount
Investment: This is the base abstract class with a unique account number, total investment value, an annual interest rate and the pure virtual functions: liquidate(amount withdrawn), createMonthlyStatement( ) and print( ) member functions. [20 pts] SavingsAccount: Suppose that this investment type has a service charge if it falls below a minimum balance. [20 pts] RealEstate: Suppose that this investment type has N= number of properties and cash reserve percentage. Each property value is determined as follows: [20 pts] Property value = (total investment value cash reserve) / (N = number of properties}
Can someone help me get the Investment class right and then help started on SavingsAccount
investment.h
#ifndef INVESTMENT_H
#define INVESTMENT_H #include
class Investment { int accountNum; double investmentValue = 5000; double interestRate = 0.01;
public: virtual void liquidate() = 0; virtual void createMonthlyStatement() = 0; virtual void print() = 0;
};
#endif // !INVESTMENT_H
SavingsAccount.h
#pragma once #include "Investment.h" class SavingsAccount :Investment { public:
void serviceCharge(); private: double balance; double charge; };
SavingsAccount.cpp
#include "SavingsAccount.h" #include
using namespace std;
void SavingsAccount::serviceCharge() { if (balance < 1000) { double charge = (0.02 * balance);
cout << "You have been charged " << charge << "for falling below 1000 dollars.";
balance = balance - charge;
cout << " Your current balance is: " << balance; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started