Python Programming: An Introduction to Computer Science
Python Programming: An Introduction to Computer Science
3rd Edition
ISBN: 9781590282779
Author: John Zelle
Publisher: Franklin Beedle & Associates
bartleby

Videos

Question
Book Icon
Chapter 11, Problem 16PE
Program Plan Intro

Statistical calculation

Program Plan:

  • Import the header file
  • Define the “StatSet” class
    • Define the “init ()” method
      • Set the array
    • Define the “addNumber ()” method
      • Append the numbers
    • Define the “mean ()”method
      • Set the values
      • Iterate “num” until it reaches the value
        • Add the “sum”
          • Return the result
    • Define the “median ()” method
      • Sort the value
      • Set the length of the “stats”
      • Calculate the “midPos” value
      • Check “size” mod 2 is equal to 0
        • Calculate the “median”
          • Otherwise, calculate the value
    • Define the “stdDev ()” method
      • Call the “mean ()” method
      • Set the value
      • Iterate “num” until it reaches a value
        • Calculate the “dev”
        • Calculate the “sumDevSq”
          • Return the result
    • Define “count ()” method
      • Return the count
    • Define the “min ()” method
      • Call the “sort ()” method
      • Return the value
    • Define the “max ()” method
      • Call the “sort ()” method
      • Return the result
  • Define the main method
    • Call the “StatSet” class
    • Iterate “i” until it reaches 12
      • Call the “addNumber ()” method
    • Display the results.
  • Call the main method.

Blurred answer
Students have asked these similar questions
Write the SQL code that permits to implement the tables: Student and Transcript. NB: Add the constraints on the attributes – keys and other.
Draw an ERD that will involve the entity types: Professor, Student, Department and Course. Be sure to add relationship types, key attributes, attributes and multiplicity on the ERD.
Draw an ERD that represents a book in a library system. Be sure to add relationship types, key attributes, attributes and multiplicity on the ERD.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY