EECS 12 Summer 2006 Homework 0

General Instructions

Please place your programs in seperate files named as described in the problem. Improperly named programs will not count. Turn in your files by placing them in the dropbox. Please be mindful of the late policy.

Grading

Correct80%
Commented10%
Attempted10%

Problems

Problem 0: 20 points

Create a python program named hellos.py that prints the following when run:


Hello, World!
Hello, State!
Hi, Mom!

Problem 1: 80 points

Create a python program named vars.py that does the following:

  1. Assigns a two-digit number to the variable number
  2. Displays number
  3. Adds 90 to number and stores the result in sum0
  4. Removes the hundreds digit and stores the digit in hundreds and the value resulting from the removal in hundredsRemoved
  5. Adds hundreds to hundredsRemoved and stores the result in sum1
  6. Adds 9 to sum1 and stores it in sum2
  7. Displays sum2

Hint: number should be the same as sum2