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
Taya2010 [7]
3 years ago
15

You are to create a program using Python that asks the user for a nonnegative number, then computes the mean and variance using

the above given online update formulas which should be displayed on the console screen. The program should end when a user enters a negative number.
Computers and Technology
1 answer:
Alik [6]3 years ago
7 0

Answer:

# In the new version of python is available the functions mean() an variance()

# In the module of statistics

i = 0 #Var to input the elements

l = [] #Var to store the elements on a list

while(i>0):

    print("In put a positive number to add in the list or negative to exit ")

    i = input()

    l.append(i)

    print("The mean of the all elements is: " + mean(l) )

    print("The variance of the all elements is: " + variance(i) )

Explanation:

At present, you can use in the <em>news python's verison</em> e.g. (python 3.7) the <em>statistics module</em> and use functions like <em>mean(), variance(), stdev()</em> and many others.

In the first step you create two variables, i to recieve the inputs of a loop and l to store all the elements recieved in the<em> i</em> variable. after that you pass as an argument the list that you stored before and get the <em>mean()</em> and <em>variance()</em> of the all elements in the list.

I hope it's help you.

You might be interested in
Which of the following is not a storage medium?
GarryVolchara [31]

Answer:

microphone

Explanation:

when you are using a microphone once it stop it done

8 0
3 years ago
Read 2 more answers
Complete the program segment below to write the numbers 1 through 50 to the numbers.txt file.
Ludmilka [50]

Answer:Usisksk

Explanation:

Js JSU’s

8 0
3 years ago
Which below best describes JavaScript? *
marysya [2.9K]

Answer:

it is a programing languwage that is useualy used to program visual or text based applications

Explanation:

6 0
3 years ago
Read 2 more answers
TRUE OR FALSE !!!!
NeX [460]

Answer:

True

Explanation:

4 0
3 years ago
Read 2 more answers
Design a class named Car that has the following fields:
snow_tiger [21]

Answer:

// The class car is defined

public  class Car {

  // instance variable yearModel

  private int yearModel;

  // instance variable make

  private String make;

  // instance variable speed

  private int speed;

 

  // empty constructor

  // with instances inside it

  // the instances are from the question

  public Car(){

      yearModel = 2000;

      make = "Nissan";

      speed = 4;

  }  

  // overloaded constructor

  // constructor defined with three arguments

  public Car(int yearModel, String make, int speed) {

      // the arguments are assigned to the object's variable

      this.yearModel = yearModel;

      this.make = make;

      this.speed =speed;

  }

  // setter(mutator) method

  public void setYearModel(int yearModel){

      this.yearModel = yearModel;

  }

  // setter(mutator) method

  public void setMake(String make){

      this.make = make;

  }

  // setter(mutator) method

  public void setSpeed(int speed){

      this.speed = speed;

  }

  // getter(accessor) method

  public int getYearModel(){

      return yearModel;

   }

  // getter(accessor) method

  public String getMake(){

      return make;

   }

  // getter(accessor) method

  public int getSpeed(){

      return speed;

   }  

  // toString is override to display the car object properties

  public String toString(){

      return "Car's year model: " + getYearModel() + ", make: " + getMake() + ", speed: " + getSpeed();

  }

}

Explanation:

The code is well commented.

4 0
3 years ago
Other questions:
  • In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the
    12·1 answer
  • Question 1<br> a node is.<br> •a sever<br> A Cell Phone<br> A Laptop<br> a device on a network
    13·1 answer
  • Technician A says you should measure the parasitic load immediately after the vehicle is turned off. Technician B says you shoul
    10·1 answer
  • "Write a class named Car that has the following data attributes:" _ _year_model (for the car’s year model) _ _make (for the make
    12·1 answer
  • How many 1000-Watt lights can be plugged into a standard 120-Volt, 15-Amp outlet? (Hint: W/V=A) *
    7·1 answer
  • - A blacksmith is shoeing a miser's horse. The blacksmith charges ten dollars for his work. The miser refuses to pay. "Very well
    6·1 answer
  • 100 POINTS
    13·1 answer
  • What component of a game makes victories feel earned and helps the player become physchologically engaged by the play experience
    11·1 answer
  • Mavis is considering signing up for a hosted enterprise software solution for her small business. She recognizes that an advanta
    15·1 answer
  • Can someone please help me! It’s due Thursday!
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!