1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ymorist [56]
3 years ago
11

Statisticians would like to have a set of functions to compute the mean, median and mode of a list of numbers. The mean is the a

verage of the numbers in the list. The median is the number that would appear at the midpoint of a list if it were sorted. The mode is the number that appears most frequently in the list. Define these functions. Please use the starter code stats.py. Expected output: List: [27, 5, 18, 66, 12, 5, 9] Mode: 5 Median: 12 Mean: 20.285714285714285
Computers and Technology
1 answer:
Rufina [12.5K]3 years ago
3 0

Answer:

<em>Python Programming Language</em>

import statistics

mylist =  [27, 5, 18, 66, 12, 5, 9]

print("Mode: ",statistics.mode(mylist))

print("Median: ",statistics.median(mylist))

print("Mean: ",statistics.mean(mylist))

Explanation:

This line imports stats.py into the program

import statistics

This line defines a list <em>(The example list in the program)</em>

mylist =  [27, 5, 18, 66, 12, 5, 9]

This line uses the defined function to calculate and print the mode

print("Mode: ",statistics.mode(mylist))

This line uses the defined function to calculate and print the median

print("Median: ",statistics.median(mylist))

This line uses the defined function to calculate and print the mean

print("Mean: ",statistics.mean(mylist))

You might be interested in
A painting company has determined that for every 115 square feet or wall space, one gallon of paint and eight hours of labor wil
Kay [80]

The program to calculate the total paint cost and other values is given below.

#include <iostream>

using namespace std;

int main() {  

 int rooms, laborChrg = 18;

 float paintChrg;

 float feetPerRoom[rooms];  

 float paintReq, laborHrs, paintCost, laborCost, totalCost, totalsqft=0;  

 cout<<"Enter the number of rooms to be painted "<<endl;

 cin>>rooms;  

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

 {

 cout<<"Enter the square feet in room "<<endl;

 cin>>feetPerRoom[i];  

 // shortcut operator which is equivalent to totalsqft = totalsqft +     feetPerRoom[i];

 totalsqft += feetPerRoom[i];

 }  

 cout<<"Enter the cost of the paint per gallon "<<endl;

 cin>>paintChrg;  

 laborHrs = (totalsqft/115)*8;

 laborCost = laborHrs * laborChrg;  

 paintReq = totalsqft/115;

 paintCost = paintReq * paintChrg;  

 totalCost = laborCost + paintCost;  

 cout<<"The number of gallons of paint required "<<paintReq<<endl;

 cout<<"The hours of labor required "<<laborHrs<<endl;

 cout<<"The cost of the paint is "<<paintCost<<endl;

 cout<<"The labor charges are "<<laborHrs<<endl;

 cout<<"The Total cost of the paint job is "<<totalCost<<endl;  

 return 0;

}

Explanation:

The header files for input and output are imported.

#include <iostream>

using namespace std;

All the variables are taken as float except labour charge per hour and number of rooms.

The user is asked to input the number of rooms to be painted. An array holds the square feet in each room to be painted.

cout<<"Enter the number of rooms to be painted "<<endl;

cin>>rooms;  

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

{

cout<<"Enter the square feet in room "<<endl;

cin>>feetPerRoom[i];  

totalsqft += feetPerRoom[i];

}  

The above code asks for square feet in each room and calculates the total square feet to be painted simultaneously.

All the data to be displayed is calculated based on the values of labor charge per hour and gallons of paint needed, given in the question.

laborHrs = (totalsqft/115)*8;

laborCost = laborHrs * laborChrg;

paintReq = totalsqft/115;

paintCost = paintReq * paintChrg;

totalCost = laborCost + paintCost;

All the calculated values are displayed in the mentioned order.

7 0
3 years ago
James gets a job at a multinational corporation. On his first day at work, he finds out that the numerical code assigned by the
s2008m [1.1K]

Answer:

IP address

Explanation:

In computer networks, every computer has assigned with a unique address that is called logical address or IP address.

This address is assigned by ICANN and used to access that particular computer by other computers on the network.

3 0
3 years ago
What is the argument in this function =AVERAGE(F3:F26)
monitta
The argument for the function would be answer "D".
5 0
3 years ago
Question 83 :Which type of fiber optic connector connects to a terminating device by pushing the connector into the terminating
STALIN [3.7K]

The Lucent connector(LC) is a type of fiber optic connector used here.

Explanation:

A Lucent connector (LC) is a type of fiber optic connector connects to a terminating device by pushing the connector into the terminating device and can be removed by depressing the tab on the connector and pulling it out of the terminating device.

It is a standard ceramic Ferrule connector and has good performance and is favored for single mode.

LC is a latched connector which have same handling capacities like SC. They have small flange on top similar to an RJ-45 connector that aids secure connection. It has a smaller connector housing and a smaller 1.25 mm ferrule.

3 0
3 years ago
When computers are connected and operate through one main computer, it is called a _________ network
adoni [48]
It might be a LAN or Host network. I'm not sure about your question, but your answer might reside in your notes for this class. 
6 0
3 years ago
Read 2 more answers
Other questions:
  • Imported data that maintains a refreshable link to its external source is called ____ data.
    7·1 answer
  • Line spacing refers to the amount of space between each line in a paragraph. A. True B. False
    14·2 answers
  • Place the steps in order to link and place text into the document outline, effectively creating a master document.
    8·1 answer
  • Thomas drew a rectangle with an area of 6 square cm what is the greatest possible perimeter of this rectangle
    5·1 answer
  • Which type of NAC agent will be used during the posture assessment before allowing access to the VPN users?
    9·1 answer
  • Assume variables SimpleWriter out and int n are already declared in each case. Write a while loop that printsA. All squares less
    11·1 answer
  • HI How are you anyways are any of you intreseted in my giveaway
    7·2 answers
  • BADM-Provide a reflection of at least 500 words (or 2 pages double spaced) of how the knowledge, skills, or theories of this cou
    7·1 answer
  • Create a Flowchart and write pseudocode for a program that allows the user to enter two integer values: a and b.
    8·1 answer
  • Explica el empleo de cuentas y contraseñas en archivos
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!