V22.0002 - Summer 2010 - Nathan Hull

Assignment #1 - Due: Thursday, July 1


1.) Write a program that uses three variables as integers. First,  two of the variables should be multiplied by each other and stored in the third variable. Then display all three variables and their values on the screen. Finally, display an example of a division problem (one variable divided by another) and display the results on the screen. This program should be named as follows:

LastNameFirstName_integers.py (for example, BondJames_integers.py)

Next, list out at least five ways to “crash” the program and document your errors. Please include at least one syntax, one logic, and one run-time error. Please include these errors as comments in the program so that the program will still run!

2.) Do you remember Mad Libs?

This program should prompt the user for a minimum of eight inputs (six text inputs with at least two numbers) and then print out your "mad lib" result! Here is a sample partial run:

Sample input:

Enter an adjective: purple
Enter another adjective: ancient
Enter a noun: dragon
Enter another noun: spoon

Sample output:

Here is your mad lib!!
The purple bear went into the ancient house.
There she saw a dragon and a spoon.

This program should be named as follows:

LastNameFirstName_madlib.py (for example, ShakespeareWilliam_madlib.py)

3.) Submit all programs by emailing them as attachments to the grader at: v002su2 [at] cs [dot] nyu [dot] edu