Interest Calculator using C++

c++ is very fast because it is a memory managing language. today we made a interest calculator using c++.
Interest Calculator using c++

Namaste!

Today, I started learning C++ concepts and really learned some things.

I practiced them on vscode and made a simple interest calculator NAtive Application.

First, open your code editor then we have to define a function operation for calculating the interest of the value which we will give to the program.

//This is function for calculation of Interest
float FinalAmount(int currentmoney, float factor){
    return currentmoney+((currentmoney*factor)/100);
}

Now, we will go to main( ) and write the code for input value and output value.

for input we will use cin>>Your variable;

for output we will right cout<<“Text to Print”<<Variable <<endl;

*endl is used for line break as we use <br> in .html

 int money;
    float Interest;
    cout<<"Enter the money you have"<<endl;
    cin>>money;
    cout<<money<<" Rs. you have now"<<endl;
    cout<<"Now Enter the interest rate"<<endl;
    cin>>Interest;
    cout<<"If you have "<<money<<" and Interest Rate is "
        <<Interest<<" Then Final Amount will be "
        <<FinalAmount(money,Interest)<<endl;
    cout<<"Where Interest Amount is "
        <<(FinalAmount(money,Interest)-money)<<"Rs."<<endl;
    cout<<money<<" + "<<(FinalAmount(money,Interest) - money)
        <<" = "<<FinalAmount(money,Interest)<<"Rs."<<endl;
    cout<<"Thank You!"<<endl;

The final code will look like this,

Interest Calculator using C++

Thank You!

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
Computer Network: Networking

Computer Network: Networking

Next Post
water drop using html css

Water Drop using CSS

Total
0
Share