CS 1620 Assignment #4 Spring 2001

How to handin.
Due : Thursday Feb 15, 2001 @ midnight
Note : Late assignments will be accepted only with the instructor's pre-approval.
Marks will be awarded for comments, style, readability, compiling and working correctly.
  1. From the textbook: page 142, self-check exercises #1 and #2.

  2. Write a program that generates a company letterhead using three functions. The first function prints the standard company letterhead. The second function prints a statement indicating that the account is past due.The third function prints a closing statement.

    Here is a sample of an output

                             Seven Monkeys Co.,
                             Animal Club
                             Savana, Africa 
    
    Dear Mr./Mrs Zombie:
    Your account is past due. We appreciate your prompt payment.  
    
                             Sincerely,
                             Lionnet K.
    

  3. Write a program asking the user to enter two numbers (integer or float). The program then calls one function that adds the numbers and another function that substracts them. The numbers are passed as parameters to the functions which return their sum and difference. The program displays the sum and difference of the two numbers.

    Here is a sample of an input/output

     Enter two numbers: 231 78
     The sum  is: 308
     The diff is: 153
    
    Note: Use any combination of integers and float to test your program.

  4. Write a function to compute the monthly loan payment as follows. The function accepts three parameters: the amount of a loan (principal), the number of months a payment is to be made (period), and the annual interest rate as a decimal. The function should calculate and return the monthly payment. In general most of the banks use the following formula :

    monthly payment = (rate × principal/12)/ (1 - (1 + rate/12)-period)

    Write a driver program to test this function.


Assignment List | Prev | Next | Computer Science 2620
Department of Mathematics & Computer Science
University of Lethbridge Home Page