Horje
yearly interest calculator c++  using for loop Code Example
yearly interest calculator c++ using for loop
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

void main()
{
// Inputs //

double princ = 0.0;
double rate = 0.0;
int years = 0;
int year = 1;
double total = 0.0;

// Ask User For INFO //

cout << "What is the principle? ";
cin >> princ;
cout << "What is the rate in decimal? ";
cin >> rate;
cout << "how many years? ";
cin >> years;



for (double total; total = princ*(1+rate)*year;)
{
cout << "The balance after year " << year << " is "<< total << endl << endl;
year += 1;
}

while((years + 1)!= year);

system("pause");
}




Cpp

Related
ue4 c++ enum variable declaration Code Example ue4 c++ enum variable declaration Code Example
lnk2001 unresolved external symbol __imp_PlaySoundA Code Example lnk2001 unresolved external symbol __imp_PlaySoundA Code Example
cast unreal c++ Code Example cast unreal c++ Code Example
why wont a function stop C++ Code Example why wont a function stop C++ Code Example
reverse a stack in c++ using another stack Code Example reverse a stack in c++ using another stack Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9