### Need help with this source code!

This is the problem:

This is my code:

 ``123456789101112131415161718192021222324252627282930313233`` ``````#include using namespace std; int main() { //declaration int months; double amount_needed,face_value,monthly_payment; double rate; //input cout <<"Enter amount needed\n"; cin >> amount_needed; cout <<"Enter the interest rate\n"; cin >> rate; cout <<"Enter the duration of the loan\n"; cin >> months; //calculation face_value=amount_needed/(1-rate*(months/12)); monthly_payment=face_value/months; //output cout <<"Your loan amount should be \$" << face_value << "to get \$" << amount_needed << endl; cout << "You'll pay \$" <

I just need to know if the equations are correct or if theres a error.
Thanks
Last edited on
Please use code tags so we can refer to line numbers.

Run a few test using known values and see if the output is what is expected.

I do not understand your formula.

`Interest = Principle * Rate* Time`
How do i use the code tags.Im new to this site.
 ``123456789101112131415161718192021222324252627282930313233`` ``````#include using namespace std; int main() { //declaration int months; double amount_needed,face_value,monthly_payment; double rate; //input cout <<"Enter amount needed\n"; cin >> amount_needed; cout <<"Enter the interest rate\n"; cin >> rate; cout <<"Enter the duration of the loan\n"; cin >> months; //calculation face_value=amount_needed/(1-rate*(months/12)); monthly_payment=face_value/months; //output cout <<"Your loan amount should be \$" << face_value << "to get \$" << amount_needed << endl; cout << "You'll pay \$" <
Just click edit on your original post, highlight your code and under the format option is a pair of` <> `which is for source code.
Already did it. The program run but i think i have a logic error.
Topic archived. No new replies allowed.