Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Programming Lab 9 | Introduction to Computer Concepts | CSCE 101, Lab Reports of Computer Science

Material Type: Lab; Class: INTRO-COMPUTER CONCEPTS; Subject: Computer Science & Engineering; University: University of South Carolina - Columbia; Term: Spring 2008;

Typology: Lab Reports

Pre 2010

Uploaded on 09/02/2009

koofers-user-17r-1
koofers-user-17r-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Programming Lab 9 | Introduction to Computer Concepts | CSCE 101 and more Lab Reports Computer Science in PDF only on Docsity! Programming Lab 9 The semester is fast approaching its end and you are preparing for graduation. You are very excited about the new job you have landed but this also means that it is time to start paying back your student loans. You have accumulated a total of $20,000 in loans. The particular type of loan you received is subject to a monthly processing fee that depends on the amount of your payment as shown in the table below. Note that the minimum allowable payment amount is $50. Payment Amount Processing Fee Rate $50-$100 5% $101-$200 3% > $200 1% Write a program that will calculate the number of months it will take you to pay off your student loan debt.  Declare two integer variables called balance and payment. Balance represents the dollar amount of your debt and payment represents the amount you think you can pay every month. Note that by making the balance and payment variables of type integer, we can only input/output whole dollar amounts (no cents, e.g. 90 but not 90.01).  For each of these two variables, output a phrase asking the user to input a value for the variable followed by an input statement.  Declare an integer variable called processing_fee. This variable represents the monthly processing fee depending on your payment amount. You will need to write an expression to calculate this value after the user has input his/her monthly payment amount. Hint: You will need a nested if statement for this.  Declare an integer variable called payment_no. Assign the numeric value 1 to the variable payment_no.  Develop an algorithm to solve this problem. Convert the algorithm to Ch code. You will need to use a while loop to make the monthly calculations. Output the payment number (payment_no) and the remaining balance for each payment until the debt is paid off. Use endl so that it will be easy to read on the screen. Hint: The output statement should be inside the while loop.  Output a message indicating whether it will take less or more than three years to pay off the debt. You will need an if statement for this.  Test and debug your program. Your program will not look exactly like anyone else’s.