CS 1620 Assignment #2 Fall 2000

How to handin.
Due: Thurs Oct 5, 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. Write a program that reads in the firstName and the lastName of a person and should print it out in the following format:
    lastName, firstName
    
    followed by the message,
    Welcome to the CS1620 — Fall 2000
    I hope you will enjoy it!
    
  2. Write a program that reads a number of seconds and displays the hours, minutes and seconds equivalent. Test your program using the output of program 3.
  3. Write a program that reads in hours, minutes and seconds, and convert them to seconds only. Test your program using the output of program 2.
  4. The large "economy" size of an item is not always a better buy than the smaller size. This is particularly true when buying pizzas. Pizza sizes are given as the diameter of the pizza in inches. However, the quantity of pizza is determined by the area of the pizza and the area is not proportional to the diameter. Most people cannot easily estimate the difference in area between a ten-inch pizza and the twelve-inch pizza, and so cannot easily determine which size is the best buy — that is, which size has the lowest price per square inch. Write a program that helps the user to make her/his decision by printing out the price per square inch for two pizzas with different sizes and prices.

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