Create a loan payment program that can be used for any loan amount such as a home or car loan. The program should ask the user for the input values below, compute the monthly payment, then compute the monthly balance. Display the balance in a table

9 views (last 30 days)
Create a loan payment program that can be used for any loan amount such as a home or car loan. The program should ask the user for the input values below, compute the monthly payment, then compute the monthly balance. Display the balance in a table
Month Balance
1 $ ##.##
2 $ ##.##
3 $ ##.## . . . etc
Use the formula ??? = ? ∗ ?(1+?)? (1+?)?−1
PMT = the monthly payment. P = the principal r = the interest rate per month, which equals the annual interest rate divided by 12 n = the total number of months You can know if you have it right when the last month’s balance is $0.
  1 Comment
Steven Lord
Steven Lord on 2 Mar 2020
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

Sign in to comment.

Answers (1)

Anuja Barge
Anuja Barge on 25 Oct 2020
#include stdio.h
#include math.h
int main()
{ float i = 0.314; float j = 0.25; float k = 6.25; float sin_value = sin(i); float cos_value = cos(i); float tan_value = tan(i); float sinh_value = sinh(j); float cosh_value = cosh(j); float tanh_value = tanh(j); float log_value = log(k); float log10_value = log10(k); float exp_value = exp(k);
printf("The value of sin(%f) : %f \n", i, sin_value);
printf("The value of cos(%f) : %f \n", i, cos_value);
printf("The value of tan(%f) : %f \n", i, tan_value);
printf("The value of sinh(%f) : %f \n", j, sinh_value);
printf("The value of cosh(%f) : %f \n", j, cosh_value);
printf("The value of tanh(%f) : %f \n", j, tanh_value);
printf("The value of log(%f) : %f \n", k, log_value);
printf("The value of log10(%f) : %f \n",k,log10_value);
printf("The value of exp(%f) : %f \n",k, exp_value);
return 0;
}

Categories

Find more on Just for fun in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!