Question

4. For the following problem submit a photo of the flowchart and shots of your Python screens showing the program code and the output. Your task is to input from the teacher the test score of each student and to output the highest score. You need to check each score to make sure it is valid (at least 0 and at most 100). If it is not valid, keep prompting for a valid score until you get one. After a valid score is input, process it, and then ask the teacher if she has another score to enter. When you run the program, test the logic when the score entered is invalid when it is a valid score, and when the teacher says she has no more scores to enter. 5. For the following problem submit a photo of the flowchart and shots of your Python screens showing the program code and the output. There are 6 students in the group. Ask each student to enter the number of minutes it took them to complete the homework. Only accept a non-negative number. If the number entered is negative, keep prompting until a non-negative number is entered. Find the average number of minutes to complete homework. Print a message that includes the average number of minutes. Check the logic of your code by seeing what happens when you enter an invaliod number of minutes and when vou enter a valid number of minutes.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def getScore():
while True:
score = int(input("Enter the score: \n"))
if score >= 0 and score <= 100:
print("Valid score")
break
else:
print("Invalid score")
return score

while True:
print(getScore())
choice = input("Do you want to enter more(yes/no):")
if choice != "yes":
break

def getMinutes():
while True:
minutes = int(input("Enter the minutes: \n"))
if minutes > 0:
print("Valid minutes")
break
else:
print("Invalid minutes")
return minutes

sum = 0
for i in range(6):
sum += getMinutes()
print("Avgerage = ", sum / 6.0)

Let me know if you have any queries or clarifications.... :)

Add a comment
Know the answer?
Add Answer to:
4. For the following problem submit a photo of the flowchart and shots of your Python...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a flowchart and a program; test the program. Program Requirements. - There are 10 members...

    Create a flowchart and a program; test the program. Program Requirements. - There are 10 members of the team. The program asks each member to enter their tennis rank.It only accepts an integer between 1 and 5 inclusive.. If the number entered is not valid, the program keeps prompting until a valid number is entered. The program calculates and prints the average rank. -Submit a photo of your flowchart and a screen shot of your python program.Test the Program: Check...

  • Create a flowchart and a program; test the program. Program Requirements. There are 10 members of...

    Create a flowchart and a program; test the program. Program Requirements. There are 10 members of the team. The program asks each member to enter their tennis rank. It only accepts an integer between 1 and 5 inclusive.. If the number entered is not valid, the program keeps prompting until a valid number is entered. The program calculates and prints the average rank. Submit a photo of your flowchart and a screen shot of your program. Test the Program: Check...

  • PYTHON CODE PLEASEEEEE. Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has...

    PYTHON CODE PLEASEEEEE. Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has asked you to design a program that grades the written portion of the driver’s license exam. The exam has 20 multiple choice questions. Here are the correct answers: 1.B 6.A 11.B 16.C 2.D 7.B 12.C 17.C 3.A 8.A 13.D 18.B 4.A 9.C 14.A 19.D 5.C 10.D 15.D 20.A Your program should store these correct answers in an array. (Store each question’s correct answer in...

  • In python, Implement a function studentID() which allows the user to enter the 7-digit student ID....

    In python, Implement a function studentID() which allows the user to enter the 7-digit student ID. The program will keep prompting the user for a last name and first name. If the student does not have a student ID on record, the program will then ask for the student ID, and store that information. If the student already has a student ID, the program will display it, and ask for confirmation whether a new studentID should be assigned (and, if...

  • Flowchart for Python program: Design and create a program for the ULM Coffee Shop to provide...

    Flowchart for Python program: Design and create a program for the ULM Coffee Shop to provide some customer market research data. When a customer places an order, a clerk asks for the customer’s zip code and age. The clerk enters that data as well as the number of items the customer orders. The program operates continuously until the clerk enters a 0 for zip code at the end of the day. When the clerk enters an invalid zip code (more...

  • Write a program in Python to solve the following task: In this project, you will build...

    Write a program in Python to solve the following task: In this project, you will build a phone number from digits entered by your user. Your program will loop until 10 valid digits have been entered. It will then use those digits to display the phone number entered using the format: XXXXXXXXXX (or (XXX) XXX – XXXX for extra credit). The program will ask for a digit, it will check to see if the digit is actually between 0 and...

  • PYTHON Write a program to enter a valid variable till the user wants to end. The...

    PYTHON Write a program to enter a valid variable till the user wants to end. The program should display the count of positive, negative, zeros and letters (upper and lower case)/symbols (error handling) entered. Based on the problem, you need to design an algorithm as follows: 1. Get the user input until “n” is entered 2. Add to the positive if it is greater than zero 3. Add to the negative if it is less than zero 4. Add to...

  • 1) Which of the following is NOT true about a Python variable? a) A Python variable...

    1) Which of the following is NOT true about a Python variable? a) A Python variable must have a value b) A Python variable can be deleted c) The lifetime of a Python variable is the whole duration of a program execution.   d) A Python variable can have the value None.        2) Given the code segment:        What is the result of executing the code segment? a) Syntax error b) Runtime error c) No error      d) Logic error 3) What...

  • build a phone number from digits entered by your user. Your program will loop until 10...

    build a phone number from digits entered by your user. Your program will loop until 10 valid digits have been entered. It will then use those digits to display the phone number entered using the format: XXXXXXXXXX (or (XXX) XXX – XXXX for extra credit). The program will ask for a digit, it will check to see if the digit is actually between 0 and 9 inclusively. If so, the digit will be stored as the next number in the...

  • Overview Module 3 Assignment 1 features the design of a pseudocode and a Python program that...

    Overview Module 3 Assignment 1 features the design of a pseudocode and a Python program that uses iteration to guess a number from 1 to 10. Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program. Instructions Write pseudocode for a Python program that uses iteration to guess a number from...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT