you are correct sirAtelo wrote:I got the impression he was looking for the line of C++ code that would calculate it, not just the math formula.
Hey you programming nerds
This is what my program looks like
#include <iostream>
using namespace std;
int main () {
int principle, years, interest;
cout<< "Please enter the starting principle, then the number of years it will\
be in the bank, and then the interest rate in percentage."<< endl;
cin>> principle >> years >> interest;
while (years >= 1 ){
principle = principle + (principle * interest / 100);
}
cout<< "You will have $" <<principle<< " in the bank."<< endl;
}
But it does nothing
#include <iostream>
using namespace std;
int main () {
int principle, years, interest;
cout<< "Please enter the starting principle, then the number of years it will\
be in the bank, and then the interest rate in percentage."<< endl;
cin>> principle >> years >> interest;
while (years >= 1 ){
principle = principle + (principle * interest / 100);
}
cout<< "You will have $" <<principle<< " in the bank."<< endl;
}
But it does nothing
WORLD OF LOGS #1's
Force choking the shit out of bitches!
Force choking the shit out of bitches!
Does nothing? Does it compile and do nothing? Does it give errors during compile or when executed? Does it give the wrong value?
I haven't programmed in 10 years but I remember including <stdio.h>, I have no idea if it's still needed.
There appears to be something wrong with your loop and use of 'years'.
I haven't programmed in 10 years but I remember including <stdio.h>, I have no idea if it's still needed.
There appears to be something wrong with your loop and use of 'years'.