Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Design a new data structure to hold a sequence of numbers and various statistics about that sequence. Design a struct to hold a

In C++ Design a new data structure to hold a sequence of numbers and various statistics about that sequence. Design a struct to hold a sequence of doubles and its corresponding mean, median, mode, standard deviation and variance. You will probably need to declare a vector of that structure to do the following.

(a) Write a function to read multiple sequences from the user and store them in your data structure. You should read as many sequences as the user wishes to input. You will need to figure out how to distinguish one sequence from another as the user inputs numbers, and how to determine if the user has finished inputting all the sequences.

(b) Write a function that computes the mean of each sequence and store that value in your data structure.

(c) Write a function that computes the median of each sequence and store that value in your data structure.

(d) Write a function that computes the mode of each sequence and store those values in your data structure.

(e) Write a function that computes the standard deviation of each sequence and store that value in your data structure.

(f) Write a function that computes the variance of each sequence and store that value in your data structure.

(g) Write a function to display the mean, median, mode, standard deviation and variance of each sequence input by the user.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions