First Summer 2008


Homework Two: Basic use of if statements.
Due date
Thursday May 15, 11:59pm

Late policy
E-mail the solutions as a text file to Adrian by the due date.

Late submissions will be accepted for full credit if:

Work policy
Working in groups is encouraged but please turn in your own version of the assignment.

Also, please make sure you

with the Computer Science Department's Statement on Academic Integrity before turning in your assignment.

Task
  1. Write a program that simulates a clock for ten minutes. Here's how mine works:
    Please enter the starting time.
    Start by specifying the hour: 9
    Next please specify the minutes: 56
    The clock shows  09:56
    Here are the next ten minutes:
    09:57
    09:58
    09:59
    10:00
    10:01
    10:02
    10:03
    10:04
    10:05
    10:06
    My clock uses military format:
    Please enter the starting time.
    Start by specifying the hour: 23
    Next please specify the minutes: 55
    The clock shows  23:55
    Here are the next ten minutes:
    23:56
    23:57
    23:58
    23:59
    00:00
    00:01
    00:02
    00:03
    00:04
    00:05
  2. Write a program that reads a number less than 12 and prints the name of the corresponding month in the year.

    Here's how mine works:

    Enter month number: 5
    May
    
    Note that the first month's number is not 0 (which is, in fact, out of range).
    Enter month number: 0
    Number out of range.
    The first month's number is 1.
    Enter month number: 1
    January
    Valid numbers being between 1 and 12, 13 is the first number out of range.
    Enter month number: 13
    Number out of range.
    Negative numbers are out of range.
    Enter month number: -2
    Number out of range.
    December is 12.
    Enter month number: 12
    December
    If the user enters floating point numbers or non-numeric strings the result is not specified.
Grading
Feedback by e-mail should reach you in 12 hours from the time of your submission.

If feedback doesn't come contact Adrian by e-mail or phone and report it.

Grades will be posted within 24 hours of your submission on your individual blog once the blog is activated.

Individual blogs have been activated and initialized Sat May 10, we will start posting grades on them starting Mon May 12 in the evening.