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 average 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

Answers

Answer 1

Answer:

Python Programming Language

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 (The example list in the program)

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))


Related Questions

Suppose you are implementing the Comparable interface in a class representing a Book, where the ordering is based on the number of pages in the book. Write a compareTo method for this class. You may assume that in the Book class there is an instance variable called numPages and a method called getNumPages.

Answers

Answer:

Following are the code to this question:

public class Book implements Comparable<Book> //defining a class that inherits the interface

{

int numPage; //defining integer variable numPage

int getNumPage()//defining a method getNumPage

{

return numPage; //use return keyword to return numPage value

}

int compareTo(Book b)//defining a method compareTo that uses Book instance b

{

   //using multiple conditions

if (getNumPage() > b.getNumPage())//defining if block that checks getNumPage method value is greater then instance of getNumPage  

{

return 1; //return value 1

}

else if (getNumPage() == b.getNumPage())//defining else if block that checks method and its instance value is euqal    

{

return 0;//return 0

}

else //defining else block

{

return -1;//return value -1

}

}

}

Explanation:

In the above-given code, a class book is defined, that inherits the interface that is "Comparable<Book>". Inside the class, an integer variable "numPage" and a method "getNumPages" is defined, that returns the "numPage" value.

In the next step, the "compareTo" method is declared, which uses an instance of the book and use the conditional statement.

In the if block, It checks the "getNumPages" method value is greater than the instance of the "getNumPages" method if the value is true, it will return "1", otherwise goto else if block. In this block, it will check both "method and instance of method" values are equal, if the condition is true, it will return "0". In the else block, if the above condition is false, it will return the value that is "-1".  

3.19 LAB: Seasons In C++ Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to represent the day. Ex: If the input is: April 11 the output is: Spring In addition, check if the string and int are valid (an actual month and day). Ex: If the input is: Blue 65 the output is: Invalid The dates for each season are: Spring: March 20 - June 20 Summer: June 21 - September 21 Autumn: September 22 - December 20 Winter: December 21 - March 19

Answers

Answer:

#include <iostream>

#include <string>

using namespace std;

int main() {

  string mth;

int dy;

cin >> mth >> dy;

if ((mth == "January" && dy >= 1 && dy <= 31) || (mth == "February" && dy >= 1 && dy <= 29) || (mth == "March" && dy >= 1 && dy <= 19) || (mth == "December" && dy >= 21 && dy <= 30))

cout << "Winter" << endl;

else if ((mth == "April" && dy >= 1 && dy <= 30) || (mth == "May" && dy >= 1 && dy <= 30) || (mth == "March" && dy >= 20 && dy <= 31) || (mth == "June" && dy >= 1 && dy <= 20))

cout << "Spring" << endl;

else if ((mth == "July" && dy >= 1 && dy <= 31) || (mth == "August" && dy >= 1 && dy <= 31) || (mth == "June" && dy >= 21 && dy <= 30) || (mth == "September" && dy >= 1 && dy <= 21))

cout << "Summer" << endl;

else if ((mth == "October" && dy >= 1 && dy <= 31) || (mth == "November" && dy >= 1 && dy <= 30) || (mth == "September" && dy >= 22 && dy <= 30) || (mth == "December" && dy >= 0 && dy <= 20))

cout << "Autumn" << endl;

else

cout << "Invalid" << endl;

  return 0;

}

Explanation:

Answer: sorry this is in coral

integer inputMonth

integer inputDay

inputMonth = Get next input

inputDay = Get next input

if (inputMonth == 1 and inputDay >= 1 and inputDay <= 31)

Put "winter" to output

elseif (inputMonth == 2 and inputDay >= 1 and inputDay <= 29)

Put "winter" to output

elseif (inputMonth == 3)

if (inputDay >= 1 and inputDay <= 19)

Put "winter" to output

elseif (inputDay > 19 and inputDay <= 31)

Put "spring" to output

elseif (inputDay >=32)

Put "invalid" to output

elseif (inputMonth == 4 and inputDay >=1 and inputDay <= 30)

Put "spring" to output

elseif (inputMonth == 5 and inputDay >=1 and inputDay <= 31)

Put "spring" to output

elseif (inputMonth == 6)

if (inputDay >=1 and inputDay <= 20)

Put "spring" to output

elseif (inputDay >= 21 and inputDay <= 30)

Put "summer" to output

elseif (inputDay >=31)

Put "invalid" to output

elseif (inputMonth == 7 and inputDay >=1 and inputDay <= 31)

Put "summer" to output

elseif (inputMonth == 8 and inputDay >=1 and inputDay <= 30)

Put "summer" to output

elseif (inputMonth == 9)

if (inputDay >=1 and inputDay <=21)

Put "summer" to output

elseif (inputDay >= 22 and inputDay <=30)

Put "autumn" to output

elseif (inputDay >=31)

Put "invalid" to output

elseif (inputMonth == 10 and inputDay >=1 and inputDay <= 31)

Put "autumn" to output

elseif (inputMonth == 11 and inputDay >=1 and inputDay <= 30)

Put "autumn" to output

elseif (inputMonth == 12)

if (inputDay <= 0)

Put "invalid" to output

elseif (inputDay >= 1 and inputDay <= 20)

Put "autumn" to output

elseif (inputDay >=21 and inputDay<=31)

Put"winter" to output

else

Put "invalid" to output

Explanation:

The information gathered by a probe, analyzed locally, and transmitted to a remote network management, is called

Answers

Answer:

Remote Network Monitoring (RMON)

Explanation:

The information gathered by a probe, analyzed locally, and transmitted to a remote network management, is called Remote Network Monitoring (RMON).

The Remote Network Monitoring (RMON) was developed in the early 1990s by Internet Engineering Task Force (IETF), which comprises of operators, network designers, researchers and vendors, saddled with the responsibility of designing, developing and promoting internet standards. It is a standardized method for monitoring, analyzing and troubleshooting network traffic on a remote ethernet transport (typically, through its port) to find network connection issues such as network collisions, dropped packets, and traffic congestion. A Remote Network Monitoring (RMON) is an extension of the Simple Network Management Protocol (SNMP) used to gather and manage informations or data about network systems performance.

In order to remotely monitor and gather informations about networks, a RMON probe which can either be a software or hardware is embedded into a network device with a Transmission Control Protocol and Internet Protocol (TCP/IP) such as a switch or router.

Basically, there are two (2) main versions of the Remote Network Monitoring (RMON);

1. RMON 1.

2. RMON 2.

Broken computers are being eco-recycled by the user. Which stage of the hardware lifecycle does this scenario belong to

Answers

Answer:

Decommission, E-cycle & Disposal

Explanation:

The life cycle of every hardware starts from its architectural design and ends when the hardware is being disposed of.

The reason for disposal could be as a result of when hardware becomes broken down (as stated in the question) or got outdated or out of place.

However, the stage that this belongs to is called "Decommission, E-cycle & Disposal" stage of the hardware lifecycle.

Recall that at a high level, categories of inter-process communication (IPC) facilities include those that share memory and those that transfer data. Which of the following statements are correct about IPC facilities?
A. Facilities that use data transfer, such as FIFO, can only be used between a parent process and a child process.
B. Facilities that share memory require more care in synchronizing data sharing.
C. Facilities that share memory can communicate a lot faster.

Answers

Answer:

Facilities that share memory require more care in synchronizing data sharing (B) and facilities that share memory can communicate a lot faster ( C )

Explanation:

The true statements about IPC facilities are : Facilities that share memory require more care in synchronizing data sharing  and facilities that share memory can communicate a lot faster.   this is because facilities that require the sharing of memory between themselves require more care in the synchronization of data and  also copying of messages is prohibited which in turn makes it faster for the facilities to communicate a lot faster.

In the Access Query window, the upper portion of the window contains the design grid.a) trueb) false

Answers

Answer:

b) false

Explanation:

Access Query Window comprises of two major parts which are:

1. Upper part: this is otherwise referred to as Show Table. It is the top part of the window which displays tables, fields, or subqueries that can be utilized in the query.

2. Lower part: this is otherwise referred to as the Design Table/Grid. It is the bottom part of the window which displays columns that can be utilized to create fields by the users.

Hence, the right answer is Option B: False

What is the relationship between data, information, business intelligence, and knowledge?

Answers

Answer:

The answer is below

Explanation:

Given the following:

Data is oftentimes described as actual truth or evidence about a situation or condition.

Information, on the other hand, is described as a refined data

Business Intelligence is defined as a combination of several information utilized in the decision-making process.

Knowledge is basically described as a form of intellectual properties, which encompasses a lot of experiences, skills, and creativity.

Therefore, the main relationship between all these is the utilization of these resources to enhance and improve the decision-making process. This is because, the gathered DATA is converted to INFORMATION, which in turn used to build BUSINESS INTELLIGENCE and finally, through the combination of past experiences, skills and talent, leads to a wealth of KNOWLEDGE to enhance and improve the decision-making process.

A high school in the United States has a relationship with a high school in Japan. all the students in each school are assigned to a student at the other school. The students write messages to each other week, describing what they did in school that week. This program is most strongly repeated to which aspect in life? Society, culture, ethics, or economy?

Answers

Answer:

Culture

Explanation:

Culture is defined as the way of life of a particular group of people.

The Japanese have their unique culture and the Americans also have their own unique culture, so if there is an exchange of message between a student from the United States and a student in Japan, and they write each other messages every week, describing what they did in school that week, then the program is most strongly repeated to the cultural aspect in life.

If you define CSS rules on a parent control, the rules will be inherited by all of the children widgets.
A. True
B. False

Answers

Answer:

TRUE

Explanation:

Which tool encrypts entire drives, rendering them unusable unless one possesses the correct key to unlock the drive?

Answers

Answer:

Whole disk encryption.

Explanation:

Whole disk encryption, also known as, the full disk encryption is a tool that encrypts the entire drive. The whole disk encryption protects the whole hard drive from unwanted visitor to enter into your system.

This tool protects your entire data, softwares, files, etc stored in the hard drive. Whole disk encryption cedes the entire hard drive unusuable untill correct key is entered to unlock the drive.

Thus the correct answer is 'whole disk encryption.

Which of the following is the general term used to describe software code that isdesigned to cause damage to a computer system?
A) Virus
B) Malware
C) Adware
D) Madware

Answers

Answer:

B. Malware

Explanation:

Malware is the general term used to describe software code that is designed to cause damage to a computer system

Malware also known as malicious software. It is a single term which refers to virus, trojans, adware spy ware, rogue, scare ware, worm etc.

They are intentionally designed to cause damage to a computer system.

QuickBooks Learn & Support 888-210-2883 - QuickBooks - Intuit,,,

Answers

QuickBooks Learn & Support 888-210-2883 - QuickBooks - Intuit,,,

What is the most important quality of lossless compression?

Answers

Answer:

Text

Explanation:

When a file is being compressed from it original form to a compressed form, it's important that the text retains its unique form or at the very least, it should be similar to its original form

This is so because a little drop in quality can cause distortion to the text and thereby changing its meaning or making it unreadable.

The most important quality of lossless compression is that there is no data loss.

Lossless compression is the use of data compression algorithms or techniques to compress an original data to a compressed data with no data loss in the compression process.

Hence, the contents of the compressed data is identical to the original data, therefore the original data to can be reconstructed from the compressed data.

We can conclude that there should be no loss of data during lossless compression.

You can find more on data compression at: https://brainly.com/question/19878993

Which of the following help departments organize unique access controls for access to folders and data files within a department or group so that only those employees who need access to confidential data are granted access?
A. Title-based access controls.
B. Role-based access controls.
C. Administrative access controls.
D. Privacy-based access controls.

Answers

Answer:

B. Role-based access controls

Explanation:

Roll-based access control is a way to control access to the network and to data which depends on the position of employees in a department. This way the permission to access information are granted according to roles that are assigned to employees. This type of access control allows access privileges to employees only to the folders and data files which they need in order to perform their tasks and it does not allow them to access the data or information which is not relevant to them. This helps the department to secure the sensitive information and data files and reduces the risk of data breaches.

The SmoothWall open source firewall solution uses colors to differentiate networks. Which color indicates the private, trusted segment of a network

Answers

Answer:

Green

Explanation:

The Green color indicates the private, trusted segment of a network.

The Smoothwall open source firewall solution makes use of colors in order to differentiate networks. Other colors like red denote connection to the internet, purple and orange are used to designate DMZs for wireless access points.

Smoothwall is usually configured via web-based GUI and does not really require much knowledge to install or use.

Fiber deployment architectures include all of the following except:
A. Free space optic (FSO).
B. Mesh.
C. Ring.
D. Point to multipoint (PMP).

Answers

Answer:

C

Explanation:

The answer should C.

Which if the following ribbons in Microsoft word is used to add tables and images

Answers

Answer:

Insert tab

Explanation:

It is the second tab in the Ribbon. As the name suggests, it is used to insert or add extra features in your document. It is commonly used to add tables, pictures, clip art, shapes, page number, etc.

Identify and define the root in the word belligerent HELP ME PLZ

Answers

The root belli means war and in war opposing spillers are very hostile or aggressive with each other. So belli means war and the definition is hostile or aggressive.

Answer:

belli

Explanation:

belli means war

A customer wants to set up a VLAN interface for a Layer 2 Ethernet port. Which two mandatory options are used to configure a VLAN interface? (Choose two.)

Answers

Incomplete question. Here's the full question:

Which two mandatory options are used to configure a VLAN interface?  

A customer wants to set up a VLAN interface for a Layer 2 Ethernet port.

Which two mandatory options are used to configure a VLAN interface? (Choose two.)

A. Virtual router

B. Security zone

C. ARP entries

D. Netflow Profile

Answer:

A. Virtual router

B. Security zone

Explanation:

According to the networking protocol to create a virtual local area network (VLAN) you must:

1.  Have a configured Virtual router

2.  Create or configure a Layer 2 Security Zones.

Although there are other network requirements to successfully create VLAN but this are the basic ones needed.

What is the ability for a system to respond to unexpected failures or system crashes as the backup system immediately and automatically takes over with no loss of service

Answers

Answer:

The appropriate answer will be "Fault Tolerance".

Explanation:

This relates to and is therefore a device rather than a program with nothing more than a self-contained contingency mechanism that enables uninterrupted supply when key characteristics fail. A system has been regarded as fault-tolerant although this keeps working satisfactory manner throughout the existence of one and sometimes more circumstances of failure.

What type of switch is used to combine multiple network connections into a single link?a. core switchb. gateway switchc. aggregation switchd. access switch

Answers

Answer:

C. Aggregation switch.

Explanation:

Aggregation switch is a type of switch used to combine multiple network connections into a single link.

In Computer Networking, Aggregation switches are primarily designed to be used for connecting the Top-of-Rack (ToR) switches to a core switch or router, as the case may be.

Generally, the core switch is typically placed at the top of the data center network architecture topology.

An aggregation switch is usually designed to be large in size and has a lot of interfaces or ports for the connection of multiple networks into a single logical link.

Additionally, the connections are mainly done in parallel in order to prevent total downtime or redundancy in a network, as well as to enhance the throughput than what is obtainable in a single network.

A description of information use mapping is to identify opportunities for additional feedback mechanisms.A. TrueB. False

Answers

Answer: True

Explanation: Information mapping could simply be explained as a procedure employed in matching or pitting together relevant articles, information or thoughts on a certain idea or relating to a particular domain. These gathered information are of immense importance in business and other domains as it helps manufactures and service providers with the needed data required to identify consumer wants and available opportunities. Hence information use mapping provide additional feedback opportunities enabling businesses to adjust, provide better services.

Which of the following are screen objects used to maintain, view, and print data from a database?
A. Form.
B. Field.
C. Data files.
D. Entities.

Answers

The answer is Forms. hope this helped

definition of a network, what three components are used to create a network?

Answers

Answer:

There are three primary components to understanding networks: 1. Physical Connections; 2. Network Operating System; and 3. Application Component. ... However, the whole network stops if the main cable or bus is severed or disconnected.

Explanation:

A palindrome is a string that reads the same forward and backward. a substring is a contiguous subset of characters in a string. Given a string s how many distinct substrings of s are palindromes

Answers

Answer:

Here is the Python program to compute how many distinct substrings of a string s are palindromes:

def AllPalindromes(s, l, h, sub):  #function that finds all the palindromes

while l >= 0 and h < len(s) and s[l] == s[h]:  #the loop iterates and reads the s until s[l.h] is a palindrome

 sub.add(s[l: h + 1])  #adds the palindromes to sub

 l = l - 1  #decrements the count of l by 1

 h = h + 1 #increments the count of h by 1

def DistinctPalindromes(s):  #function to find all distinct palindromic substrings of s and also their number

substr = set()  #stores all distinct substrings of s which are palindromes

for i in range(len(s)):  #iterates through s

 AllPalindromes(s, i, i,substr) # find all  palindromes with odd length and with s[i] as mid point

 AllPalindromes(s, i, i + 1, substr) # find all  palindromes with even length and with s[i] as mid point

print("palindromic substrings are",substr, '\n',end='')  # display all distinct palindromic substrings

print(len(substr),"distinct substrings of",s,"are palindromes") # display the number of distinct palindromic substrings

print("Enter a string:")  #prompts user to enter a string

s = input()  #accepts input from user

DistinctPalindromes(s)  #calls DistinctPalindromes method by passing input string to it in order to compute the

Explanation:

The program is well explained in the comments attached with each statement of the code. The function AllPalindromes finds all the palindromes of string s. while loop iterates and reads the string forward and backward to find same i.e. palindrome. Here h and l represents high and low part of the string s. They can also be called as forward and backward pointers to the s characters. The while condition also checks the characters at s[l] position in the string s is equal to the character at s[h].  add() method is used to push all palindromes into the set  sub. The function DistinctPalindromes is used to find all the distinct substrings of s that are palindromes. The loop iterates through characters of string s and calls AllPalindromes method to find all palindromes with odd and even length. It then prints the distinct palindromic substrings . For examples s = "aabaa" then the palindromic substrings are {'aabaa', 'b', 'aba', 'a', 'aa'}  and the number of distinct substrings of aabaa that are palindromes is 5. The program along with its output is attached in a screenshot.

Research and discuss web navigation.
Include discussion of web site navigation design patterns.
Please, use your own words.

Answers

Answer:

Answered below

Explanation:

Web navigation is the pattern in which information can be accessed through the navigation of a network of resources on the web. A good web navigation design enhances usability and ease of finding information, and as a result, improves user experience.

In hierarchical web navigation, the website navigation is structured in a general to specific order.

Global navigation shows all the main sections of the website such as home, about, contacts etc.

Local navigation provides links within the pages of the website where users can navigate to other related pages of the website.

Design uses styles such as navigation bar, drop-down menu, site map and fly-out menu to create user interfaces that enhance navigation.

Which of the following laptop features allows users to overcome keyboard size restrictions?
A. Touchpad
B. Numeric Keypad
C. Fn Key
D. Digitizer

Answers

Answer:

C. Fn Key

Explanation:

The Fn key represents the function key that used for the dual purpose. It is to be activated with the help of shift key. Also, it controls the functions of the hardware i.e. brightness of the computer or laptop screen, volume of the speaker, etc

Also, it overcomes the restrictions with respect to the size of the keyboard

hence, the correct option is c.  

Fn Key

Is a laptop features allows users to overcome keyboard size restrictions.

The architecture in which the database resides on a back-end machine and users access data through their workstations is

Answers

Answer:

Client-server

Explanation: The client-server model is a type of model or architecture in which a client (Customer) requests for services from another known as the server which serves as the service provider.

In the client-server architecture, the database resides in the back end machine, from where services can be rendered to the client or users.

Answer:

Client-Server Model

Explanation:

The Client-Server model structure divides tasks between clients, which are the the requesters of services, and servers, which are the providers of services or resources.

Information or data, is usually stored securely in the backend or server machine. Users then access these information by communicating with the server over a computer network.

Example is when a user requests a webpage using a website's address. The server gets the request from the client and finds the page in the database residing in the backend, then serves it up to the user when found.

Which of the following combines something you know, such as a password, with something you are (a biometric device such as a fingerprint or a retina scan) or something you possess (a smart card or a USB stick)?a. Confidentiality b. Authentication c. Two-factor authentication

Answers

Answer:

c. Two-factor authentication

Explanation:

The type of security measure that is being described is known as Two-Factor authentication. This is a security measure in which an individual is only granted access after successfully presenting two or more pieces of evidence to an authentication mechanism. These two forms of evidence can vary from service to service, for example a company may require that the user enter a password and a fingerprint scan, or may ask for a password and SMS code sent to the individual's phone.

Which of these statements regarding the computer platform is true?

A.computer game titles are more expensive than their console counterparts.

B. The computer platform is proprietary.

C. Requirements vary depending on the game title.

D. computer monitors have a lower resolution than television screens.

Answers

Answer:

i would say c.

Explanation:

some of the new AAA games that are made with higher graphics will require a better graphics card. and usually require a higher core cpu and more RAM.

It c but I hope is correct
Other Questions
Point O is on line segment \overline{NP} NP . Given OP=8OP=8 and NO=2,NO=2, determine the length \overline{NP}. NP Santa Fe Company purchased merchandise for resale from Mesa Company with an invoice price of $27,100 and credit terms of 3/10, n/60 the merchandise had cost Mesa $16,000. Santa Fe paid within the discount period. Assume that both buyer and seller use a perpetual inventory system.Required:a. Prepare entries that the buyer should record for (a) the purchase and (b) the cash paymentb. Prepare entries that the seller should record for (a) the sale and (b) the cash collectionc. Assume that the buyer borrowed enough cash to pay the balance on the last day of the discount period at an annual interest rate of 8% and paid it back on the last day of the credit period. Compute how much the buyer saved by following this strategy. (Assume a 365-day year and round dollar amounts to the nearest cent, including computation of interest per day.) Greg bought a new car for 18000.In the first year the value of the car depreciates by 30%.In the second year and the third year the car depreciates by 14%Work out the value of the car after three years. How can Mario complete his task without leaving the word application? use the samples; diamond, dolomite, gneiss, and chalk and provide your analysis of composition and identification based on their identification characteristics. why does Columbus talk about converting the native peoples to Christianity? In each box please put one or more words that start with that letter that relate to social studies. Example A= Africa, Arctic Ocean, etc. Which is equivalent to 1.04? What is the best inference readers can make based on the claims in the advertisement?Apex is the only reliable internet streaming service in the area.Apex has more channels for the money than some other streaming services.All other streaming services charge more per channel than Apex does.Other streaming services offer less desirable channels than Apex. What are values? sociology A company borrowed from the bank by signing a longterm note. How does this transaction affect the accounting equation? Who Influenced the 8th Amendment of the Constitution? * A:Jean Jacques Rousseau B:Baron de Montesquieu C:John Locke D:Cesare Beccaria E:Voltaire What is the value of x? According to scott, the coo of barcelona restaurant group, employees are given the opportunity and freedom to achieve organizational goals through a variety of different approaches, tasks, and decisions, based on the situation. this is most consistent with the: Someone please help me with 1-4! What term best fits the following places: Florida, Baja of California, and India? Show that the set of solutions of a second-order linear homogeneous differential equation is linearly independent. {eax, xeax}, a b Find the Wronskian for the set of solutions. {eax, xeax}, a b What is (2 hundreds 3 tens)x 10 in standard form which represents a function? For 1983 through 1989, the per capita consumptionof chicken in the U.S. increased at arate that was approximately linear. In 1983,the per capita consumption was 37.1 pounds,and in 1989 it was 50 pounds.Write a linear model for per capita consumptionof chicken in the U.S. Let t representtime in years, where t = 3 represents1983. Let y represent chicken consumption inpounds.