Tuesday, December 29, 2020

Compound Interest in C++

 Machine Problem in C++

Write a C++ program to input principal amount, time and rate  (P, T, R) from user and find compound interest of a loan.

am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

/* compound_interest.cpp

Machine Problem in C++

Write a C++ program to input principal amount, time and rate 
(P, T, R) from user and find compound interest of a loan.

Mr. Jake Rodriguez Pomperada, MAED-IT, MIT
www.jakerpomperada.com
www.jakerpomperada.blogspot.com
jakerpomperada@gmail.com
Bacolod City, Negros Occidental Philippines
*/

#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <cmath>

int main()
{
    double principal_amount=0.00, time=0.00, rate=0.00,amount=0.00;
    double compound_interest=0.00;
    
    std::cout <<"\n\n";
    std::cout <<"\tCompound Interest in C++";
    std::cout <<"\n\n";
    std::cout <<"\tGive Principal Amount     : ";
    std::cin >> principal_amount;
    
    std::cout <<"\n";
    std::cout <<"\tGive Time Duration        : ";
    std::cin >>time;
    std::cout <<"\n";
    std::cout <<"\tGive Annual Interest Rate : ";
    std::cin >>rate;

    // Calculate compound  interest 
     amount=principal_amount*pow((1 +rate/100),time);
 
     compound_interest=amount-principal_amount;

    std::cout <<"\n";
    std::cout << std::setprecision(2); 
    std::cout << std::fixed;
    std::cout <<"\tThe Compound Interest is $ "
     <<compound_interest;
    std::cout <<"\n\n";
    system("pause");
    
}


No comments:

Post a Comment