2 MAX_AVERAGES = 8 Summary 3 4 # Declare array here. In this lab, you complete a partially prewritten Python 5 program that uses a list. 6 # Write a loop to get batting averages from user and assign to array. 7 averageString = input("Enter a batting average: ") battingAverage = float(averageString) # Assign value to array. 8 The program prompts the user to interactively enter eight 9 batting averages, which the program stores in an array. It 10 should then find the minimum and maximum batting 11 averages stored in the array, as well as the average of the 12 # Assign the first element in the array to be the minimum and the maxim 13 minAverage = averages[Ø] 14 maxAverage = averages[0] 15 # Start out your total with the value of the first element in the array 16 total = averages[®] 17 # Write a loop here to access array values starting with averages[1] eight batting averages. The data file provided for this lab includes the input statement and some variable declarations. Comments are included in the file to help you write the remainder of the program. 18 Instructions 19 # Within the loop test for minimum and maximum batting averages. 20 21 1. Make sure the file BattingAverage.py is selected and 22 open. 23 2. Write the Python statements as indicated by the 24 # Also accumulate a total of all batting averages. 25 comments. 26 27 # Calculate the average of the 8 batting averages. 3. Execute the program by clicking the Run button at 28 the bottom of the screen. Enter the following batting 29 averages: .299, .157, .242, .203, .198, .333, .27O, .190. 30 # Print the batting averages stored in the averages array. 31 The minimum batting average should be .157 and the 32 maximum batting average should be .333. The 33 # Print the maximum batting average, minimum batting average, and avera average should be .2365. average. 34
2 MAX_AVERAGES = 8 Summary 3 4 # Declare array here. In this lab, you complete a partially prewritten Python 5 program that uses a list. 6 # Write a loop to get batting averages from user and assign to array. 7 averageString = input("Enter a batting average: ") battingAverage = float(averageString) # Assign value to array. 8 The program prompts the user to interactively enter eight 9 batting averages, which the program stores in an array. It 10 should then find the minimum and maximum batting 11 averages stored in the array, as well as the average of the 12 # Assign the first element in the array to be the minimum and the maxim 13 minAverage = averages[Ø] 14 maxAverage = averages[0] 15 # Start out your total with the value of the first element in the array 16 total = averages[®] 17 # Write a loop here to access array values starting with averages[1] eight batting averages. The data file provided for this lab includes the input statement and some variable declarations. Comments are included in the file to help you write the remainder of the program. 18 Instructions 19 # Within the loop test for minimum and maximum batting averages. 20 21 1. Make sure the file BattingAverage.py is selected and 22 open. 23 2. Write the Python statements as indicated by the 24 # Also accumulate a total of all batting averages. 25 comments. 26 27 # Calculate the average of the 8 batting averages. 3. Execute the program by clicking the Run button at 28 the bottom of the screen. Enter the following batting 29 averages: .299, .157, .242, .203, .198, .333, .27O, .190. 30 # Print the batting averages stored in the averages array. 31 The minimum batting average should be .157 and the 32 maximum batting average should be .333. The 33 # Print the maximum batting average, minimum batting average, and avera average should be .2365. average. 34
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY