Answer to Question #173228 in C++ for Karthick Soundar C

Question #173228

Declare a class Fixed_Deposit with member variables are principal, rate and time, and member functions are MaturityAmount() to calculate the compound interest and maturity amount, and display() to print the total maturity amount(principal+compound interest).


1
Expert's answer
2021-03-19T12:28:42-0400
#include <iostream>
class Fixed_Deposit {
public:
    float MaturityAmount() 
    {
        float percent;
        float amount;
        percent = (rate * time/360)/100;
        amount = principal * percent;
        return amount;
    }
    void display()
    {
        std::cout << "Total maturity amount " << principal + MaturityAmount();
    }
    float principal;
    float rate;
    float time;};


int main()
{
   Fixed_Deposit example;
   return 0;


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS