CST 8110 - Assignment 13

Last revised: Sunday September 27, 1998 01:06.

This assignment is due in my assignment box by 13:45 on Monday, July 28.

All assignments are evaluated based on their neatness and how closely they follow the assignment submission guidelines published in the online course notes.

Purpose and Instructions

This program demonstrates your ability to understand C language conditions and simple IF statements. To do this assignment correctly, you must read and understand the Chapter 4 sections dealing with conditional expressions and the simple IF statement.

The CST 8110 Blue Book contains the Algonquin standard for writing IF statements in C and pseudocode. The appendices contain many examples of IF statements used in programs and pseudocode. Use these examples to guide you.

Before you begin this assignment, finish reading Chapter 4. (Omit section 4.8.) Make sure you know how to do the Self-Check and Programming exercises in sections 4.2 , 4.3, and 4.4. (Verify your answers with the answers in the book.) Learn how C handles logical expressions.


  1. Finish reading Chapter 4. (Omit section 4.8.)
  2. Review the Self-Check exercises for sections 4.2, 4.3, and 4.4 on your own; bring questions to your Lab. You do not need to hand in these exercises; however, you must know how to do them.
  3. Write the modified water-bill program from the section 4.6 Exercise #1 on page 173 of the textbook.
  4. In the function that prints the instructions to the user, also print your name and student number first.
  5. Use the following two sets of input data to test your program:


    TEST SET 1

    TEST SET 2

    Unpaid balance:



    Previous reading:



    Current reading:



    Use last year:



  6. Run your program twice, once for each set of four input values. Submit only the printed output of your program. Do not submit the source program listing. The beginning of the output must have your name and student number printed in it (see above). Hand-written output will not be accepted for this assignment. Learn how to capture and print the output of your program.



The aggregate of all assignment marks comprises 25% of your final mark. All assignments must be completed satisfactorily to get credit for the course, even if the assignments are submitted too late to receive a mark. (See the course outline.)

Late assignments are handled according to the policy given in the course outline.