Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

oo Verizon 1:01 PM a cse.buffalo.edu 1 of 2 CSE 111 Fall 2017 Project #5 Parts #

ID: 3604444 • Letter: O

Question

oo Verizon 1:01 PM a cse.buffalo.edu 1 of 2 CSE 111 Fall 2017 Project #5 Parts #1 & #2 of 3 Parts #1 & #2 Due: Sunday, October 29 at 1 1:59 PM Part #3 Due: Sunday, November 5 at 11:59 PM Task #1 The Menu Program an interactive menu in Python 2. The menu should have four options: Prompt the user to enter a string, and then store the string that they enter in a variable Display the string the user entered to the screen. Note that when grading, this option won't selected until a string has been entered. Display the string entered three (3) times. End the program. 1. 2. 3. 4. Submit this program as project 5 task lpy on UB Lcarns on or before the due date. The file should be well commented and free of errors. It should also be user friendly. When the grader runs the program they should well instructed as to what to do and all results should be descriptive so they know what the user knows are looking at. Task #2 Football Using the rules of American Football, where you can score with a touchdown (7 points), field goal 3 points), or safety (2 points), write a program that: Asks the user to enter a score greater than one (1). Using the score entered in step #1, display one possible combination of touchdowns (7 points), field goals (3 points) and safeties (2 points) that can make up that score Display the greatest number of touchdowns (7 points) that may be been scored to obtain the score entered in step #1 1. 2, 3. Submit this program as project 5 task_2.py on UB Lcarns on or before the due date. The file should be well commented and free of errors. It should also be user friendly. When the grader runs the program they should well instructed as to what to do and all results should be descriptive so they know what the user knows are looking at Task #3 Football Combining what you've learned from Task #1 and Task #2, write a Python 2 program t implement a simple cash register. The cash register only holds bills (S1, S5, S10, S20, S50, and S100). The initial balance of the register is zero (0). The program will be menu driven, with the following menu options.

Explanation / Answer

Task#1

#Task 1: Taking string input from user
#and printing thrice
String = raw_input("Enter a String: ")
for i in range(3):
print String
  

Task#2


#Task2:
score = int(input("Enter the score : "))
touchdown = 7
ntd = 0
goal = 3
ngoal =0
safeties = 2
nsafeties = 0

ntd = score / touchdown
score = score%touchdown

ngoal = score/goal
score = score%goal

nsafeties = score/safeties
score = score%safeties

print("#touchdowns : %d"%ntd)
print("#goals : %d"%ngoal)
print("#safeties : %d"%nsafeties)

Task#3

#Task 3: cash register
cash = int(input("Please enter the cash: "))
l = [100,50,20,10,5,1]
cl = [0,0,0,0,0,0]

for i in range(len(l)):
cl[i] = cash/l[i]
cash = cash%l[i]
  
for i in range(len(l)):
print("%d : %d "%(l[i],cl[i]))