Test 2 CSCI 151 Version 2

Question 1 (25 points): a. Give an example of the input to print python 3 times. EXPLAIN YOUR ANSWER.

n = int(input("enter n "))
i = 5
while(i < n): b. Give an example of the input to print 24. EXPLAIN YOUR ANSWER.

n = int(input("enter n "))
i = 2
product = 1
while(i < n):
print(product)

Question 2 (75 points): Whole Foods Market runs Amazon Prime promotion: Amazon Prime Members receive an additional 10% discount on all sale items. Assuming the customer bought two items, Write a program that reads a price for each item and a sale indicator for each item (1 - item is on sale, 0 - item is not on sale). The program prints the total amount customer paid for two items. Note, in case of the sale items, the input price is already a SALE price, so only an additional 10% discount must be taken for the items that are on sale. In addition, the program will ask user to enter the price of the Amazon Prime membership and will determine if it was worthwhile. Use the following rule:

Optional: use loop WHILE