Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
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
Exercise 1:   Write a Java application that simulates a test. The test contains at least five questions about first three lectures of this course. Each question should be a multiple-choice question with 4 options.   Design a Test class. Use programmer-defined methods to implement your solution. For example: create a method to simulate the questions – simulateQuestion create a method to check the answer – checkAnswer create a method to display a random message for the user – generateMessage create a method to interact with the user - inputAnswer   Display the questions using methods of JOptionPane class. Use a loop to show all the questions.   For each question: If the user finds the right answer, display a random congratulatory message (“Excellent!”,”Good!”,”Keep up the good work!”, or “Nice work!”). If the user responds incorrectly, display an appropriate message and the correct answer (“No. Please try again”, “Wrong. Try once more”, “Don't give up!”, “No. Keep trying..”). Use…
Eclipise Exercise 1:   Write a Java application that simulates a test. The test contains at least five questions about first three lectures of this course. Each question should be a multiple-choice question with 4 options.   Design a Test class. Use programmer-defined methods to implement your solution. For example: create a method to simulate the questions – simulateQuestion create a method to check the answer – checkAnswer create a method to display a random message for the user – generateMessage create a method to interact with the user - inputAnswer   Display the questions using methods of JOptionPane class. Use a loop to show all the questions.   For each question: If the user finds the right answer, display a random congratulatory message (“Excellent!”,”Good!”,”Keep up the good work!”, or “Nice work!”). If the user responds incorrectly, display an appropriate message and the correct answer (“No. Please try again”, “Wrong. Try once more”, “Don't give up!”, “No. Keep…
Design a class named CustomerRecord that holds a customer number, name, and address. Include separate methods to 'set' the value for each data field using the parameter being passed. Include separate methods to 'get' the value for each data field, i.e. "return" the field's value. Pseudocode:
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:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY