In this lab, you complete a partially prewritten Python program that uses a list.
The program prompts the user to interactively enter eight batting averages, which the program stores in an array. It should then find the minimum and maximum batting averages stored in the array, as well as the average of the 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.
Instructions
Make sure the file BattingAverage.py is selected and open.
Write the Python statements as indicated by the comments.
Execute the program by clicking the "Run Code" button at the bottom of the screen. Enter the following batting averages: .299, .157, .242, .203, .198, .333, .270, .190. The minimum batting average should be .157 and the maximum batting average should be .333. The average should be .2365.
Grading
When you have completed your program, click the "Grade" button to record your score.
Lists
BattingAverage.py
4
43
Unix Terminal>
1 # Declare a named constant for array size here.
2 MAX_AVERAGES = 8
3?
4 # Declare array here.
5 averages = []
6 ?
7 # Write a loop to get batting averages from user and assign to array.
8 for i in range(MAX_AVERAGES):
9 averageString = input("Enter a batting average: ")
10 battingAverage = float(averageString)
11 # Assign value to array.
12 averages.append(battingAverage)
13 ?
14 # Assign the first element in the array to be the minimum and the maximum.
15 minAverage = averages[0]
16 maxAverage = averages[0]
17 # Start out your total with the value of the first element in the array.
18 total = averages[0]
19 # Write a loop here to access array values starting with averages[1]
20 ?
21 # Within the loop test for minimum and maximum batting averages.
22 for i in range(1, MAX_AVERAGES):
23 f averages[i] < minAverage:
24 minAverage = averages[i]
25 if averages[i] > maxAverage:
26 maxAverage = averages[i]
27 total += averages[i]
28 ?
29 # Also accumulate a total of all batting averages.
30 ?
31 ?
32 # Calculate the average of the 8 batting averages.
33 average = total / MAX_AVERAGES
34 ?
35 # Print the batting averages stored in the averages array.
36 for avg in averages:
37 print(avg)
38 ?
39 # Print the maximum batting average, minimum batting average, and average batting average.
40 print('Maximum batting average is ' + str(maxAverage))
41 print('Minimum batting average is ' + str(minAverage))
42 print('Average batting average is ' + str(average))
43 ?
W
Run Code
Ctrl + Enter
TestGrade

Answers

Answer 1

Answer:

See Explanation

Explanation:

Required

Complete the given code

First, it should be noted that the original code (in the question) is complete, however it is poorly formatted.

The errors that may arise when the code is run is as a result of the poor format of the code.

I've corrected all errors and I fixed the indentations in the original code.

See attachment for the complete code.


Related Questions

What are the difference between data and information?​

Answers

Answer

The terms data and information can mean different things in different contexts, but the main differences between them are: Data is a collection of facts. Information is how you understand those facts in context. Data is unorganized, while information is structured or organized.

what is a web client​

Answers

Answer:

A Web client typically refers to the Web browser in the user's machine or mobile device. It may also refer to extensions and helper applications that enhance the browser to support special services from the site.

hope this helps

have a good day :)

Explanation:

A Web client typically refers to the Web browser in the user's machine or mobile device. It may also refer to extensions and helper applications that enhance the browser to support special services from the site.

Here's an example:

Your web browser is an example of a web client. The remote machine containing the document you requested is called a web server. The client and server communicate using a special language (a "protocol") called HTTP.

Good luck!

4. Ito ay ang lugar kung saan nagtatagpo ang bawat column at
row.
A. cell
B. data
C. file tab
D. sheet tab

PATULONG ​PO PLS

Answers

Answer: A. Cell

Explanation:

A cell is the point on the worksheet that results from the intersection of a column and a row.

This is why cells can be identified by the column and row that they are the result of. For instance, a cell can be called "A12" which is also known as its "address". This means that it is a result of the intersection of "Column A" and "Row 12".

Which security measure provides protection from IP spoofing?

A ______ provides protection from IP spoofing.

PLEASE HELP I need to finish 2 assignments to pass this school year pleasee im giving my only 30 points please

Answers

Answer:

An SSL also provides protection from IP spoofing.

Complete the divisible_by(list1, int1) function below. As input, it takes a list of integers list1 and an integer int1. It should return a list with all the integers in list1 where the integer is divisible by int1. For example, divisible_by([2, 9, 4, 19, 20, -3, -15], 3) should return the list [9, -3, -15].
1 def divisible_by(listi, n):
2 # code goes here
3 pass
4
5 if _name == "__main__":
6 # use this to test your function
7 test_list = [2, 9, 4, 19, 20, -3, -15]
8 print(divisible_by(test_list, 3))

Answers

Answer:

The function is as follows:

def divisible_by(listi, n):

   mylist = []

   for i in listi:

       if i%n == 0:

           mylist.append(i)

   return mylist

   pass

Explanation:

This defines the function

def divisible_by(listi, n):

This creates an empty list

   mylist = []

This iterates through the list

   for i in listi:

This checks if the elements of the list is divisible by n

       if i%n == 0:

If yes, the number is appended to the list

           mylist.append(i)

This returns the list

   return mylist

   pass

Answer quick plzzz I only have 2 hours

Answers

Answer:

option 2

Explanation:

Answer:

B. Kathy performs tasks common to the Engineering and Technology pathway and Sean and Joan perform tasks common to the Science and Math pathway.

1) Create a class called Villain. Specifically, a Villain has the following fields: .name (String)
a number of evil plans (int) In addition, a Villain has the following methods: • a constructor that accepts an argument for each of the fields . a copy constructor
an equals method, which checks/returns whether all the fields are the same
a toString method
2) Create a class called Crazy Villain, which inherits from Villain. Specifically, a Crazy Villain has the following additional fields:
a crazy laughter (String)
a crazy idea (String In addition, write code for the following Crazy Villain methods:
a constructor that accepts an argument for each of the fields
a toString method that overrides the Villain toString method, in order to include the additional fields You do not need to instantiate/demo Villain or Crazy Villain objects.

Answers

Answer:

Explanation:

The following code is written in Java and creates both of the classes as requested with their variables and methods as needed. The crazyVillain class extends the Villain class and implements and overrides the needed variables and methods. Due to technical reasons, I have added the code as a txt file below.

Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the user to enter a string which is subsequently displayed in uppercase. It is important to first ensure that string to be converted is in the a-z range. The program does not recognize any space, symbols or any kind of punctuation marks. Any time the user enters any of this character the program is going to repeatedly ask for the valid string.

An example execution of your program could be:
Please enter your string: 1winter
Invalid Entry!
Please enter your string: summer
Your capitalized string:SUMMER

Answers

Answer:

try this

Explanation:

MSG1 DB 10,13,'enter any string:-$'

MSG2 DB 10,13,'converted string is:-$'

P1 LABEL BYTE

M1 DB 0FFH

L1 DB?

P11 DB 0FFH DUP<'$'>

DATA ENDS

DISPLAY MARCO MSG

MOV AH,9

LEA DX,MSG

INT 21H

ENDM

CODE SEGMENT

ASSUME CS: CODE,DS:DATA

START:

MOV AX,DATA

MOV DS,AX

DISPLAY MSG1

LEA DX,P1

MOV AH,0AH

INT 21H

DISPLAY MSG2

LEA SI,P1

MOV CL,L1

MOV CH,0

CHECK:

CMP[SI],61H

JB DONE

CMP[SI],5BH

UPR: SUB[SI],20H

DONE: INC SI

LOOP CHECK

DISPLAY P11

MOV AH,4CH

INT 21H

CODE ENDS

END START

List to String (0.5 points) Since we are often dealing with a list of strings, it would be useful to have a function to tum a list of strings back into one single concatenated string, This function will return a string that is each element of input_list concatenated together with each separated by the string Separator For example, the following function call: list_to_string('This', 'is's 'fun' should return; "This is fun To do this, write a function called list_to_string This function should have the following inputs, outputs, and internal procedures: Input(s) input_list - list of strings . separator - string Output(s); . output - string Procedure(s): - assign a variable called output to be the first (index 0) element from input_list - loop through the rest of input_list, looping from the 2nd element index 1) through to the end of the list - Within the loop, use string concatenator to combine output with the current element, separated by separator • Assign the output of this to be the new value of output • return output, which should now be a list of the elements of input_list joined together into a single string

Answers

Answer:

The function is as follows:

def list_to_string(input_list,separator):

   output = ""

   for inp in input_list:

       output+=inp+separator

       

   output = output[:-1]

   return output

Explanation:

Given

See attachment for instruction

Required

A function to convert list to string

This defines the string

def list_to_string(input_list,separator):

This initializes the output to an empty string

   output = ""

This iterates through the input list

   for inp in input_list:

This concatenates every string in the list including the separator

       output+=inp+separator

This removes the last character of the string

   output = output[:-1]

This returns the output string

   return output

Determining Uses for Outer Joins
Which situation would most benefit from an outer join?
a query that shows only customers who placed orders
a query that shows all duplicate customers from both tables
O a query that shows only the orders that have customers attached
a query that shows all customers, whether or not they placed an order
ve

Answers

Answer:

a query that shows all customers, whether or not they placed an order

Explanation:

EDG 21

The biggest limitation of a network operating system (NOS) is _____ in terms of memory, process, device, and file management.

Answers

Answer:

Lack of global control.

Explanation:

An operating system is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes.

This ultimately implies that, an operating system acts as an interface or intermediary between the computer end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions.

Some examples of an operating system on computers are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

There are different types of operating systems (OS) used for specific purposes and these are;

1. Batch Operating System.

2. Multitasking/Time Sharing OS.

3. Multiprocessing OS.

4. Single User OS.

5. Mobile OS.

6. Real Time OS .

7. Distributed OS.

8. Network OS.

A network operating system (NOS) can be defined as specialized computer operating system that are designed primarily for use on network devices such as routers, switches, workstations, which are mainly connected to a local area network.

Generally, the biggest limitation of a network operating system (NOS) is lack of global in terms of memory, process, device, and file management.

what is the Is option that prints to the author of a file?​

Answers

Answer:

We need to use Option - 'author' along with option- 'l'

The given SQL creates a Movie table and inserts some movies. The SELECT statement selects all movies released before January 1, 2000 Modify the SELECT statement to select the title and release date of PG-13 movies that are released after February 1, 2008. Run your solution and verify the result table shows just the titles and release dates for The Dark Knight and Crazy Rich Asians. 3 6 1 CREATE TABLE Movie ( 2 ID INT AUTO_INCREMENT, Title VARCHAR(100), 4 Rating CHAR(5) CHECK (Rating IN ('G', 'PG', 'PG-13', 'R')), 5 ReleaseDate DATE, PRIMARY KEY (ID) 7); 8 9 INSERT INTO Movie (Title, Rating, ReleaseDate) VALUES 19 ('Casablanca', 'PG', '1943-01-23'), 11 ("Bridget Jones's Diary', 'PG-13', '2001-04-13'), 12 ('The Dark Knight', 'PG-13', '2008-07-18'), 13 ("Hidden Figures', 'PG', '2017-01-06'), 14 ('Toy Story', 'G', '1995-11-22'), 15 ("Rocky', 'PG', '1976-11-21'), 16 ('Crazy Rich Asians', 'PG-13', '2018-08-15'); 17 18 -- Modify the SELECT statement: 19 SELECT * 20 FROM Movie 21 WHERE ReleaseDate < '2000-01-01'; 22

Answers

Answer:

The modified SQL code is as follows:

SELECT Title, ReleaseDate FROM movie WHERE Rating = "PG-13" and ReleaseDate >  '2008-02-01'

Explanation:

The syntax of an SQL select statement is:

SELECT c1, c2, c...n FROM table WHERE condition-1, AND/OR condition-n

In this query, we are to select only the title and the release date.

So, we have:

SELECT Title, ReleaseDate

The table name is Movie.

So, we have:

SELECT Title, ReleaseDate FROM movie

And the condition for selection is that:

Ratings must be PG-13

And the date must be later than February 1, 2008

This implies that:

Rating = "PG-13"

ReleaseDate >  '2008-02-01'

So, the complete query is:

SELECT Title, ReleaseDate FROM movie WHERE Rating = "PG-13" and ReleaseDate >  '2008-02-01'

What kinds of components are tangible assets?

Answers

Answer:

Tangible assets are physical like cash, inventory, vehicles, equipment, buildings and investments.

Explanation:

Design an algorithm to find the weighted average of four test scores. The four test scores and their respective weights are given in the following format: testscore1 weight1 ... For example, the sample data is as follows: 75 0.20 95 0.35 85 0.15 65 0.30 The user is supposed to enter the data and press a Calculate button. The program must display the weighted average.

Answers

Answer:

data = [75, 0.2, 95, 0.35, 85, 0.15]

print (f'Average weight: {sum(data) / len(data)}')

Explanation:

This is python algorithm for finding average weight. To get average weight, you sum up all data involved and divide that amount by the number of data provided.

Please help me ASAP!

Answers

Answer:

security hacker

Explanation:

security hackers are people who hack software to check for vulnerabilities. most of the time security hackers are white hat hackers who work to perform penetration tests to see if a software is secure.

tell me if this is wrong :)

The person previous to my response is correct. The answer is security hacker. In the description it specifically states that her job involves hacking into the companies system.

n
What options are available in the Lookup Wizard? Check all that apply.
label the field
sort the records
filter the records
o adjust the column width
O adjust the header height
reduce the number of columns
Je
set where to get lookup field values

Answers

Answer:

Label the field

sort records

adjust the column width

set where to get lookup fields

Explanation:

URGENTTTTTTTTTTTT
You want to find a random decimal between 0 and 1, with 0 included. Choose the correct lines of code, in the order they should appear in IDLE. Sample Output: 0.3570702149467504
>>>_________
>>>_________

from math import *
randint(0,1)
from random import *
random( )​

Answers

Answer:

from random import *

print(random())

Explanation:

You can try this in any online python ide quicker than putting the question here!

PLEASE HELP ME ASAP!!!!

Answers

The answer is A. Spyware describes software with malicious behavior that aims to gather information about a person or organization and send such information to another entity in a way that harms the user. For example by violating their privacy or endangering their device's security.

Yo I need to know where to find a ps4 for free or a very cheap price please

Answers

Download offer up from the apple store or play store and search that up there’s many good deals and sometimes comes with games and controls included for cheap!

Describing the One-to-Many Relationship
What is another name for the one-to-many relationship?
child-to-parent
O parent-to-child
O student-to-teacher
O teacher-to-student
Ve

Answers

Answer: B) Parent-to-child

Answer:

What is another name for the one-to-many relationship?

child-to-parent

Correct Answer: parent-to-child( B)

student-to-teacher

teacher-to-student

Explanation:

A security technician is configuring a new firewall appliance for a production environment. The firewall must support secure web services for client workstations on the 10.10.10.0/24 network. The same client workstations are configured to contact a server at 192.168.1.15/24 for domain name resolution.

Required:
What rules should the technician add to the firewall to allow this connectivity for the client workstations

Answers

Answer:

Explanation:

Based on the information provided in the question, the best rules that the technician should add to the firewall would be the following

Permit 10.10.10.0/24 0.0.0.0 -p tcp --dport 443

Permit 10.10.10.0/24 192.168.1.15/24 -p udp --dport 53

This is because port 443 is used for "Secure webs services" while UDP port 53 is used for queries and domain name resolution. Both of which are the main configurations that the security technician needs to obtain.

Select the correct answer from each drop-down menu.

As a technical writer, you should state your purpose in the 1. ________ of your summary. In addition, you must _
2.______ the words used in the original document while writing a summary.

1. Last sentence
1. First sentence

2. Paraphrase
2. Copy
2. Quote

Answers

Answer:

1. First sentence

2. Paraphrase

Explanation:

Just took it

You have configured a LAN with 25 workstations, three network printers, and two servers. The workstations and printers will have dynamically assigned IP addresses, and the printers always need to have the same IP address assigned. The servers will have static IP addresses. What should you install on one of the servers, and what are some of the configuration options

Answers

Answer:

install and configure on the server DHCP (Dynamic Host Configuration Protocol)

Explanation:

In this scenario, you should install and configure on the server DHCP (Dynamic Host Configuration Protocol), this protocol automatically assigns each individual PC a unique IP address and DNS server information. This protocol has various configuration options such as being able to set a range for the IP addresses so that they can be used by different devices in the system. It also allows you to directly set the subnet and passage gateway so that all of the workstations can quickly communicate with one another and quickly be targeted by the administration.

Write a recursive method named hanoi that prints a solution to the classic Towers of Hanoi puzzle. Your method should accept three integer parameters representing the number of disks, the starting page number, and ending peg number. Your method should print the solution to the game to move from the given start peg to the given end peg. For example, the call of hanoi(3, 1, 3); should print the following output to move the three pegs from peg

Answers

Answer:

Explanation:

The following recursive method is written in Java. It creates a simulation of the towers of Hanoi and outputs every step-by-step instruction on how to solve it. The output for the code can be seen in the attached picture below.

class Brainly {

   public static String hanoi(int numOfDisks, int startPeg, int endPeg) {

       int helpPeg;

       String sol1, sol2, MyStep, mysol;   // Contains moves

       if (numOfDisks == 1) {

           return "Move from " + startPeg + " to " + endPeg + "\n";

       } else {

           helpPeg = 6 - startPeg - endPeg;    // Because startPeg + helpPeg + endPeg = 6

           sol1 = hanoi(numOfDisks - 1, startPeg, helpPeg);

           MyStep = "Move from " + startPeg + " to " + endPeg + "\n";

           sol2 = hanoi(numOfDisks - 1, helpPeg, endPeg);

           mysol = sol1 + MyStep + sol2;     // + = String concatenation !

           return mysol;

       }

   }

   public static void main(String[] args) {

      String output = hanoi(3, 1, 3);

       System.out.println(output);

   }

}

The Internet is written in a "language" called
O Usenet
O package switching
O HTTP
O ARPANET​

Answers

Answer:

HTTP

Explanation:

I hope it helps u.

Mark Me as brainlist answer

HTTP

Have a great day! I hope this helped!

Who first demonstrated the computer mouse?
O Microsoft
O Alan Turing
O Douglas Engelbart
O Apple, Inc.
FAST PLEASEEE THANK YOUUU

Answers

Answer:

C. Douglas Engelbart

Explanation:

Answer: C

Explanation:

Write a program that lets the user enter the total rainfall for each of 12 months into a vector of doubles. The program will also have a vector of 12 strings to hold the names of the months. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts.

Answers

Answer:

Explanation:

#include<iostream>

#include<iomanip>

#include<vector>

using namespace std;

double getAverage(const vector<double> amounts)

{

   double sum = 0.0;

   for (int i = 0; i < amounts.size(); i++)

       sum += amounts[i];

   return(sum / (double)amounts.size());

}

int getMinimum(const vector<double> amounts)

{

   double min = amounts[0];

   int minIndex = 0;

   for (int i = 0; i < amounts.size(); i++)

   {

       if (amounts[i] < min)

       {

           min = amounts[i];

           minIndex = i;

       }

   }

   return minIndex;

}

int getMaximum(const vector<double> amounts)

{

   double max = amounts[0];

   int maxIndex = 0;

   for (int i = 0; i < amounts.size(); i++)

   {

       if (amounts[i] > max)

       {

           max = amounts[i];

           maxIndex = i;

       }

   }

   return maxIndex;

}

int main()

{

   vector<string> months;

   vector<double> rainfalls;

   months.push_back("January");

   months.push_back("February");

   months.push_back("March");

   months.push_back("April");

   months.push_back("May");

   months.push_back("June");

   months.push_back("July");

   months.push_back("August");

   months.push_back("September");

   months.push_back("October");

   months.push_back("November");

   months.push_back("December");

   cout << "Input 12 rainfall amounts for each month:\n";

   for (int i = 0; i < 12; i++)

   {

       double amt;

       cin >> amt;

       rainfalls.push_back(amt);

   }

   cout << "\nMONTHLY RAINFALL AMOUNTS\n";

   cout << setprecision(2) << fixed << showpoint;

   for (int i = 0; i < 12; i++)

       cout << left << setw(11) << months[i] << right << setw(5) << rainfalls[i] << endl;

   cout << "\nAVERAGE RAINFALL FOR THE YEAR\n" << "Average: " << getAverage(rainfalls) << endl;

   int minIndex = getMinimum(rainfalls);

   int maxIndex = getMaximum(rainfalls);

   cout << "\nMONTH AND AMOUNT FOR MINIMUM RAINFALL FOR THE YEAR\n";

   cout << months[minIndex] << " " << rainfalls[minIndex] << endl;

   cout << "\nMONTH AND AMOUNT FOR MAXIMUM RAINFALL FOR THE YEAR\n";

   cout << months[maxIndex] << " " << rainfalls[maxIndex] << endl;

   return 0;

}

You have a larger file but do not need it right away. In this scenario, you have to change the way a file is used to make it what?
O open
o closed
compressed
O usable

Answers

Answer:

Compressed

Explanation:

I hope this helps!

Answer:

usable

Explanation:

open doesnt make any sense, neither does closed and compressed is wrong i chose it and got it wrong. Its usable

Write a new method in the Rectangle class to test if a Point falls within the rectangle. For this exercise, assume that a rectangle at (0,0) with width 10 and height 5 has open upper bounds on the width and height, i.e. it stretches in the x direction from [0 to 10), where 0 is included but 10 is excluded, and from [0 to 5) in the y direction. So it does not contain the point (10, 2). These tests should pass:

Answers

Answer:

Explanation:

The Rectangle and Point class is not provided in this question but was found online. Using that code as guidance I created the following method named contains. This method takes in a Point object and checks to see if the x-axis point is inside the parameters of the Rectangle class and then checks the same for the y-axis. If it is inside the Rectangle then the method returns true otherwise it returns false.

def contains(self, point):

       return self.width > point.x >= self.corner.x and self.height > point.y >= self.corner.y

Other Questions
ay yo bruv i need help with this question 4 It's my last day of school so i don't need all these points so hereeeeeeeeeeee, remember to take care of yourself and i hope you have an amazing day!!! The lateral area of a regular pentagonal pyramid is 75 square inches and the slant height is 10 inches. Find the length of each side of the base.A) 15 in.B) 14 in.C) 7.5 in.D) 3 in The was the most important genre to Classical composers. the attendance at an athletics meeting is 14000. If 68% are men and boys and 22% are women, how many are girls Which device gives a poem the most regular, predictable rhythm?a. foreshadowingb. rhymec. free versed. meter Find the surface area: George, an unskilled worker in the 1930s, toiled 10 hours a day on an assembly line. His hours were long, his wages were low, and his working conditions were unsafe and unpleasant. George would probably have been more sympathetic to the views of John L. Lewis than to those of Samuel Gompers.a. Trueb. False Anita opened a savings account and deposited $600.00 as principal. The account earns 6% interest, compounded continuously. What is the balance after 1 year?Use the formula A=Pert, where A is the balance (final amount), P is the principal (starting amount), e is the base of natural logarithms (2.71828), r is the interest rate expressed as a decimal, and t is the time in years.Round your answer to the nearest cent. ( help please) what is the area of LMN 1/2 lbs of flour is put in a jar. If it fills 2/5 of the jar, what quantity of flour can jar? 1. Triangle ABC is similar to XYZ24 cm6 cm30 cm7.5 cm18 cm8What is the value of n in centimeters?A. 9 cmB. 4.5 cmC. 3 cmD. 12 cm To what extent should Canadians support social programs and taxation? Which sentence would provide the BEST transitionbetween the two paragraphs?Whether the purpose is to limitdistractions or to encourage self-respect, the new policy is a goodpolicy.Some workplaces are also startingto enact stricter expectations forwhat is considered a professionalappearance.I know that the administration hasfaced some opposition for thispolicy, but I think it will die downonce students get used to thechanges.ooI can assure you that I, for one, amdistracted by some of the thingspeople wear now. 6. What percent of 24 is 12?Answer plsss Which of the following is an example of uniform circular motion?A. Swinging on a swingB. Spinning on a merry-go-roundC. Sliding down a slideD. Bouncing on a trampoline Suppose that you are an emancipated slave in the South at the end of the Civil War. What changes do you hope for in your new life? Write about three ways you imagine your life will change now that you have your freedom. (ill be checking for plagiarism ) Why is it called the Dark Haired One? In number the stars? 780 is what percent of 540? Please help with this using the chain rule