Coder Social home page Coder Social logo

salemwhd / measures-of-center-measures-of-spread-calculator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 139 KB

C++ program to calculate measures of center (mean, median, mode) and measures of spread(Range, IQR, Standerd deviation, Variance)

C++ 100.00%

measures-of-center-measures-of-spread-calculator's Introduction

Statistical Measures Calculator

This project is a C++ program designed to calculate various statistical measures for a set of numbers. It provides functionalities to calculate measures of center and measures of spread. The program allows users to input a set of numbers and then select the desired statistical measure(s) to calculate.

Features

  • Calculation of Measures of Center:

    • Mean
    • Median
    • Mode
  • Calculation of Measures of Spread:

    • Range
    • Quartiles (First Quartile, Third Quartile, Interquartile Range)
    • Standard Deviation
    • Variance

How to Use

1. Input

  • Run the program and provide a set of numbers in a single line when prompted.

2. Select Type of Calculation

  • Choose the type of calculation:
    • 1: Measures of Center
    • 2: Measures of Spread

3. Choose Specific Measure(s)

  • Depending on the selected type:
    • For Measures of Center:
      • Select the desired measure: Mean, Median, Mode, or All.
    • For Measures of Spread:
      • Choose the measure(s) to calculate: Range, Quartiles, Standard Deviation, Variance, or All.

4. Repeat or Exit

  • After calculation, you can choose to perform other calculations or exit the program:
    • Y: Yes to perform more calculations.
    • N: No to exit the program.

Instructions

  • Ensure that the input set of numbers is provided in a single line, separated by spaces.
  • Follow the prompts and input the appropriate choices as per the instructions.
  • In case of wrong input, the program will prompt again to ensure correct input.

Implementation Details

The program is implemented using C++ and relies on the standard library. It includes functions to calculate various statistical measures such as mean, median, mode, range, quartiles, standard deviation, and variance.

Note

  • This program assumes valid input for the set of numbers.
  • For some statistical measures (e.g., mode), if there is no mode, the program indicates accordingly.
  • For quartiles, if the number of elements in the set is even, it calculates the quartiles accordingly.

Example

Enter set of numbers in a single line:
1 2 3 4 5 6 7 8 9
Choose type of measures to calculate:
1: Measures of center
2: Measures of spread
1
Please, choose a measure to calculate:
N: Mean
I: Median
D: Mode
A: All
A
Mean= 5
Median= 5
Mode= -1

DO you want to do other calculations?
Y: Yes
N: No
Y
Choose type of measures to calculate:
1: Measures of center
2: Measures of spread
2
Please, choose a measure to calculate:
R: Range
Q: Quartiles
S: Standard deviation
V: Variance
A: All
A
Range= 8
First quartile= 3
Second quartile= 5
Third quartile= 7
Interquartile range= 4
Standard deviation= 2.58199
Variance= 6.66667

DO you want to do other calculations?
Y: Yes
N: No
N

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.