/* File: loanpayment.c
* Compute a monthly loan payment
*
* Input: Purchase price, down payment, annual interest rate,
number of monthly payments
* Output: Amount borrowed, monthly payment
* -----------------------------------------------------------------
* Class: CS 210 Instructors: Dr. Hwang
* Assignment: In-class Exercise 3 Date : January 24, 2019
* Programmer:
*/
#include
#include
/* Function prototypes with analysis go here, TO BE WRITTEN DURING CLASS */
int main()
{
/* Main program analysis */
double purchase_price, /* Input: purchase price of vehicle */
down_payment, /* Input: down payment on vehicle */
annual_interest_rate, /* Input: annual interest rate */
amount_borrowed, /* Output: amount borrowed */
monthly_payment; /* Output: monthly loan payment */
int number_of_payments; /* Input: number of monthly payments */
/* Main program design */
/* 0. Display program banner */
printf ("LOAN PAYMENT CALCULATOR\n");
/* 1. Get inputs from the user */
printf ("\nEnter the purchase price: ");
scanf ("%lf", &purchase_price);
printf ("Enter the down payment: ");
scanf ("%lf", &down_payment);
printf ("Enter the annual interest rate (in decimal form): ");
scanf ("%lf", &annual_interest_rate);
printf ("Enter the total number of monthly payments: ");
scanf ("%d", &number_of_payments);
/* 2. Compute amount borrowed - TO BE WRITTEN DURING CLASS */
/* 3. Compute the monthly loan payment - TO BE WRITTEN DURING CLASS */
/* 4. Print out the results as shown - TO BE WRITTEN DURING CLASS */
return 0;
} /* end main */
/* Function definitions (i.e. design) go here - TO BE WRITTEN DURING CLASS */