home *** CD-ROM | disk | FTP | other *** search
- /*
- ** menu to print amortization
- ** selecting whether to compute payment or not.
- **
- **
- amount = starting balance
- balance = remaining balance
- rate = interest rate per period
- rate1 = interest rate per year
- payment = monthly payment
- principal = payment to principle
- interest = payment of interest per period
-
- *******************************************************
- * declare variables */
-
- float amount = 0;
- float balance = 0;
- float rate1 = 0;
- float rate = 0;
- float payment = 0;
- float principal = 0;
- float interest = 0;
-
-
-
- /* ************************** */
- main() /* rename to menu() */
-
- {
- int answer;
-
- float pymt();
- float interest1();
-
- scroll();
-
- printf("Would you like me to figure the payment, Y or N ? ");
-
- answer = getchar();
- answer = toupper(answer);
- scroll();
- if ((answer != 'Y') && (answer !='N') )
- main();
-
- printf("What is the amount of the loan ? ");
- scanf("%f",&amount);
-
- printf("What is the annual interest rate ? ");
- scanf("%f",&rate1);
- rate = (rate1 * .01)/12;
-
- if (answer == 'Y')
- pymt(amount,rate);
- else
- {
- printf("What is the monthly payment ? ");
- scanf("%f",&payment);
- }
-
- interest1(amount,rate,payment);
-
- }
-
-
- scroll()
- {
- int screen = 0;
- while (++screen <26)
- printf("\n");
- }
-