CS 1620 Assignment #4 Fall 2000

How to handin.
Points : 50
Due : Thursday Oct 26, 2000 @ 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. [10] Problem 8, page 164 in textbook

  2. [10] Problem 9, page 164 in textbook

  3. [10] Problem 2, page 223 in textbook

  4. [10] Write a program that reads two integers separated by an operator such as +, -, x, /, and % (there are spaces between the operator and the operands), and outputs the result of the operation. For example :

    If the inputs areThe output should be
    The operationThe result
    23 + 12 35
    12 x 6 72
    142 / 12 11
    146 % 11 3
    23 - 12 11

  5. [10] Write a program that converts times from 24 hour notation to 12 hour notation. For example, it should convert 14:25 to 2:25 PM. For example :

    If the inputs areThe output should be
    Time in 24 hour notationTime in 12 hour notation
    9:259:25 AM
    12:2512:25 PM
    14:232:23 PM
    14:63Wrong Time !!!
    24:23Wrong Time !!!

    Hints:


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