Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this programming assignment you are to extend the program you wrote for Number Stats to determine the median and mode of the numbers read

image text in transcribed
image text in transcribed
image text in transcribed
In this programming assignment you are to extend the program you wrote for Number Stats to determine the median and mode of the numbers read from the file You are to create a program called numstat2.py that reads a series of integer numbers from a file and determines and displays the following The name of the file The sum of the numbers. The count of how many numbers are in the file . . The average of the numbers. The average is the sum of the numbers divided by how many there are The minimum value The median of the numbers . The maximum value .The range of the values. The range is the maximum value minus the minimum value The mode of the numbers. The output from the program is to display the information described above using the following strings preceding the values. There is to be a space between the colon and the value File name Sum Count Average Maximum: Minimum Range Median Mode At the end of one attempt at reading, or a successful read, of a file the u they would like to evaluate another file of numbers. Use the prompt: Would you like to evaluate another file? () If the user answers y, then the program is to accept in another file name. If the user answers with anything other than y, the program is to exit. ser it to be asked if The program you write must be able to handle four different circumstances for the file that contains the number data: .The count of the numbers in the file being even. .The count of the numbers in the file being odd .The file containing only one number The file containing no numbers. (An empty file.) The user is to be told that no numbers could be found in the file The file containing an even or odd count of numbers is an issue when calculating the median which is discussed below in the Useful Information

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

Step: 3

blur-text-image

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions