CPSC-115 Fall 2008
Homework 1
Due: Beginning of class Thursday September 11, 2008
5 points
Professor Heidi Ellis

Goal: To write a flowchart that corresponds to an algorithm in outline form.

Problem:

You must write flowchart for the outline algorithm shown below. Hand in a hard copy of your flowchart at the beginning of class on Thursday 9/11.

Algorithm for computing fines on a library patron's overdue books:

  1. Initialize the patron's fine to be zero.
  2. Return a book.
  3. If the book is overdue:
    1. If the book is more than 30 days overdue:
      1. Then add to the fine a charge of $0.50 for each day the book is overdue.
      2. Else add to the fine a charge of $0.20 for each day the book is overdue.
  4. If there is another book to be returned, go to step 2.
  5. Print the patron's fine.

Helps: