CSCI 151

CSCI 151: WEEK 5 Lab Monday

Skill set for this LAB:

Problem 1:

A treasure box has a 4-digit combination lock. The box opens when you enter the following value: (sum of middle digits)*(average of first and last digit). Write a program that reads one 4-digit number, combination lock, and finds the number that opens the box.

Problem 2:

Most savings accounts offer interest to keep your money growing. Write a program that reads initial deposit into saving account and interest rate per year (as integer). The program finds and prints the amount you will have in the saving account after one year.

Problem 3:

Write a program that reads total amount of the loan taken in the bank, the down payment, and the loan tearm (the number of YEARS the loan is taken for). The program calculates and displays the monthly payment - the amount user would need to pay every month to return the loan. Make your program to round result to two decimal places.

Examples - use these examples to TEST your program Input: loan: $1200, down payment: $200, term: 1 year (pay attention it is 12 month!)
Output: the monthly payment is $83.33

  • Input: loan: $1200, down payment: $200, term: 2 year (pay attention it is 24 month!)
    Output: the monthly payment is $41.67

  • Input: loan: $2000, down payment: $600, term: 3 year (pay attention it is 36 month!)
    Output: the monthly payment is $38.89

    Problem 4:

    Write a program that calculates the final grade in TWO different courses. For the first course, the final grade is an average of midterm grade and homework grade. For the second course, the final grade is 15% of the quizzes, 35% of the homework and 50% of the midterm. Assume that input grades are INTEGERS, but your final grade must be of FLOAT type. Display final grades with 3 digits after decimal point.

    Problem 5: Write a program that calculates monthly loan payment.
    Input: original loan amount, interest (integer) and the number years the loan is taken for. THE INTEREST WILL BE APPLIED ON ORIGINAL LOAN AMOUNT AT THE BEGINNING OF THE TERM.