Homework 2

Exercise 1

Fibonacci numbers are a series of numbers. The first two numbers in the series are 1 and 1. Sucessive numbers are the sum of the pervious two. Thus, the third number is 2 (1+1). The forth number is 3 (2+1). The fifth is 5 (3+2). The series goes on like this:

1,1,2,3,5,8,13,21,34,55...

Write a program that takes a number as input and prints out that many Fibonacci numbers. For example, if I input 20 your program will print out 20 Fibonacci numbers.

Exercise 2

A company sells the following products. Each has a code and a price.
Code 	Price
CL1 	12.98
HR1 	11.98
CL2 	10.98
SR1 	11.98
SR2 	14.98 	  	  	 
SR3 	24.98
Write a script that lets people order products. Ask them to enter the code of the item they want. Then ask how many of that product they want. After that, ask if they want to add any more to their order. If they do, repeat the prompts from above (ask for code and quantity). If they do not want to add more, print out a line that says "Your order's total is XXXX" where you replace the XXXX with the actual price. Here's some example interaction:
Welcome to the store. Here are our products.

Code 	Price
CL1 	12.98
HR1 	11.98
CL2 	10.98
SR1 	11.98
SR2 	14.98 	  	  	 
SR3 	24.98

Please enter the product code you want to order: CL1
How many would you like? 2
Would you like to add anything else (Y/N): Y

Please enter the product code you want to order: SR1
How many would you like? 1
Would you like to add anything else (Y/N): N

Your order total is 37.94