c programming in VISUAL studio :(

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

I know probably sarcastic remarks paunchu hola yo posting maa but i was wondering if anyone knew how to get started on this program. I dont want like complete program just some steps on how i should get started. thanks if anyone would b able to help me out.     Purpose: The primary purpose of this assignment is to help you become familiar with repetition structures (loops).   Problem: You are to write a program that will derive an amortization schedule.  The assignment focuses on home loan refinancing and the problem of determining if you should refinance (although the calculations are applicable to almost any loan).  For this assignment, assume that compound interest is applied on the loan each month (q = 12.0) and prompt the user for the following information: loan amount (loan), interest rate (i), points (points), monthly payment (mp), and the starting month and year.  The following formula encapsulates the needed calculations (np is the number of payments).   The following steps describe how to apply the formula to derive the amortization schedule: Determine the totalLoan: loan * (1 + (points / 100)). For each month that totalLoan is greater than 0 (the loan is not paid off). Determine the monthly interest: totalLoan * i / (100 * q). Round interest to the nearest penny (multiply it by 100, add 0.5, apply floor, and divide it by 100). Determine the currentLoan: totalLoan + interest. Set the monthly payment (mp) to currentLoan if currentLoan is smaller. Determine the principal being paid: mp - interest. Update totalLoan: currentLoan - payment. NOTE:  Interest rate (i) and points (points) are converted to a rate above by dividing them by 100.   Input Instructions: Input will come from the user at the keyboard (standard input). The input values shall be entered in the following order and acceptable ranges: Loan (double value) must be >= 0.01 and <= 1,000,000.00. Interest rate (double value) must be >= 0.0 and <= 20.0. Points (double value) must be >= 0.0 and <= 20.0. Monthly payment (double value) must be > 0.0 and <= loan. Month (integer value) must be between 1 and 12 and year (integer value) must be >= 1900. Declare a constant for true, use 1 (MY_TRUE). Declare a constant for false, use 0 (MY_FALSE). Declare the integer variables valid and badInput and set badInput to MY_FALSE. Each prompt shall: Set valid to MY_FALSE. Loop while badInput and valid are both not true. Print the appropriate prompt. Use scanf to get the input value(s). If illegal input (scanf could not get all input values). Print the appropriate error message. Set badInput to MY_TRUE, allowing the system to exit without further processing. Otherwise if invalid input (a value is out of range). Print the invalid input with a message indicating it was invalid and the range of acceptable values. Otherwise Set valid to MY_TRUE, to end this prompt.

chillo · Mar 30, 2010 2:09 PM · 1,416 views

Replies
No replies yet.

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all