Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that contains the following functions: - a function that will ask the user for a test score. Only scores from 0 to

Write a program that contains the following functions:

- a function that will ask the user for a test score. Only scores from 0 to 100 are valid. If the user enters an invalid score, the function should ask them again for a valid score. The function should catch any exceptions that could be generated if the user enters non-numeric data. Once a valid score is entered, the function should return that score.

- a function that will accept a list of numbers and return the average.

The program should ask the user for three test scores, using the function described above to get valid scores. The program should then put those scores in a list and call the other function described above to get the average score. Finally, the program should display that average to the user.

Full credit if you use a loop so the number of scores can easily be changed, for example from 3 to 4, by just modifying a single parameter. Most of the credit even if it's not a loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Question What are the requirements for a SIMPLE 401(k) plan?

Answered: 1 week ago