Name(s) & ID(s):_________________________________________________________
Assignment P1
CS 100 � Summer 1999
Due: Thursday July 8, 1999 at the beginning of class.
Turn in your assignments according to the instructions given in the first day handout. Remember to include sample output when you turn in your program listings. Also turn in a disk with a runnable version of your code (the same as what you've printed). You are allowed to work with one partner on this assignment. Each problem is worth 20 points. Remember that you will be graded on both style and correctness.
How many pounds of the item do you have? 3.65
What is the price per pound of this item? 2.99
The total cost of your item is: 10.9135
The ________ professor __________ my __________, and I've never recovered.
This mad-lib needs and adjective, a verb (past tense), and a noun, in that order, in the three blanks. When the blanks are filled in, it might produce the following sentences:
The wise professor grade my paper, and I've never recovered.
The purple professor ate my computer, and I've never recovered.
Using this mad-lib, write a program that asks the user for an adjective, then a past tense verb, then a noun and then prints the completed sentence. Run your program several times (without recompiling), providing different words.
Enter the purchase amount [0-100]: 36
Your change of 64 cents is given as:
2 Quarters
1 Dimes
0 Nickels
4 Pennies
Hint: 64/25 equals 2 and 64 % 25 equals 14.