MUST BE WRITTEN IN C++ Write a program so that user can use it to compute and display various statistics for a list of at least 3 values and up to 20 positive real values. The main objectives of this project are to work with menu, arrays, file input, and modules/functions. A menu is available and user can select one of the 4 options from the menu. The program will continue until option 4 is selected. For option 1, process a predefined array in the code with 3 values (73.3 83.4 58.0). User will be able to input an array from the keyboard with a sentinel loop with option 2. Use the following values (73.3 83.4 58.0 11.9 25.1 69.9 45.7 95.0 44.4)as one of your test cases (use -1.0 as a sentinel value). When option 3 is selected, input data from a text file. Use the given p2input.txt Download p2input.txt as a test case. The values in the file are shown below. 73.3 99.0 83.4 58.0 25.1 69.0 11.9 95.0 74.8 55.0 43.5 47.4 95.6 58.9 52.6 37.7 93.8 19.9 23.9 77.2 You can assume that the user will provide a list of valid values (i.e., valid values, provide a list with at least 3 values and will not exceed the maximum number of values). After receiving a list of values via one of the options, your program shall display the original array with maximum 5 values per line, sorted array in descending order with maximum 6 values per line, maximum, average, median (only one median value is needed; need to deal with odd or even list), and sample standard deviation in a readable format using one digit after the decimal place. The sample standard deviation formula, is s=i=1N(xi-x N-1, where xi is the ith element in a list, x is the average of the values in the list, N is the number of values in the list, and s is the sample standard deviation. If you need assistance with this formula, please ask. Make sure to come up with a solid design before attempting your code on the computer. You should use a global named constant to deal with maximum number of values. You must utilize some modules/functions in your program and the following modules/functions should be incorporated in your program. However, the seven modules/functions in bold are required for the project (i.e., you must have at least five required modules/functions to get full credit). In general, it does not make sense to print a result in a Math-like function (a function that calculates a value such as average) so it just returns a value and let the caller handles the result. It doesn't make sense to print in a sort module either because its main job is to sort a list of values. You must use the same printList() module to print both the original array and the sorted array (call twice from main). We assume that an array is automatically passed by reference so "Ref is not included when designing modules/functions. Display menu and return a valid option Function Integer getMenuOption() Input a list of values from keyboard Module inputList(Real arr). Integer Ref count) Input a list of values from a file Module inputListFile(Real arr], Integer Ref count) Print a list of values in an array with specified values per line Module printList(Real arr. Integer n, Integer valuesPerLine) Sort a list of values in descending order (pick one sorting algorithm) Module sortDescending (Real arr], Integer n) Compute an average for a list of values Function Real averageList(Real arr. Integer n) Compute standard deviation for a list of values Function Real stdDeviation (Real arr. Integer n) Compute median for a sorted list of values Function Real medianSorted List(Real arr]. Integer n) Print all statistics Module printStats(Real max, Real ave, Real med, Real std) You must follow the format below for the user-interface of your program (sample output for some test cases): [Your Name]'s Statistical Calculator Program Menu 1. Use stored data 2. Input data from keyboard 3. Input data from a file 4. Quit Enter your selection -->1 There are 3 values in the data set. Original list: 73.3 83.4 58.0 Descending list: 83.4 73.3 58.0 Maximum: 83.4 Average: 71.6 Median: 73.3 Std Deviation: 12.8 Program Menu 1. Use stored data 2. Input data from keyboard 3. Input data from a file 4. Quit Enter your selection -->>2 Enter one value at a time (at least 3 and up to 20). You must enter valid data or program will not work. Enter -1 to signal end of data (-1 or -1.0). Please enter a value -> 73.3 Please enter a value -> 83.4 Please enter a value --> 58 Please enter a value -> 11.9 Please enter a value-> 25.1 Please enter a value -> 69.9 Please enter a value-> 45.7 Please enter a value -> 95.0 Please enter a value -> 44.4 Please enter a value->-1 There are 9 values in the data set. Original list: 73.3 83.4 58.0 11.9 25.1 69.9 45.7 95.0 44.4 Descending list: 95.0 83.4 73.3 69.9 58.0 45.7 44.4 25.1 11.9
MUST BE WRITTEN IN C++ Write a program so that user can use it to compute and display various statistics for a list of at least 3 values and up to 20 positive real values. The main objectives of this project are to work with menu, arrays, file input, and modules/functions. A menu is available and user can select one of the 4 options from the menu. The program will continue until option 4 is selected. For option 1, process a predefined array in the code with 3 values (73.3 83.4 58.0). User will be able to input an array from the keyboard with a sentinel loop with option 2. Use the following values (73.3 83.4 58.0 11.9 25.1 69.9 45.7 95.0 44.4)as one of your test cases (use -1.0 as a sentinel value). When option 3 is selected, input data from a text file. Use the given p2input.txt Download p2input.txt as a test case. The values in the file are shown below. 73.3 99.0 83.4 58.0 25.1 69.0 11.9 95.0 74.8 55.0 43.5 47.4 95.6 58.9 52.6 37.7 93.8 19.9 23.9 77.2 You can assume that the user will provide a list of valid values (i.e., valid values, provide a list with at least 3 values and will not exceed the maximum number of values). After receiving a list of values via one of the options, your program shall display the original array with maximum 5 values per line, sorted array in descending order with maximum 6 values per line, maximum, average, median (only one median value is needed; need to deal with odd or even list), and sample standard deviation in a readable format using one digit after the decimal place. The sample standard deviation formula, is s=i=1N(xi-x N-1, where xi is the ith element in a list, x is the average of the values in the list, N is the number of values in the list, and s is the sample standard deviation. If you need assistance with this formula, please ask. Make sure to come up with a solid design before attempting your code on the computer. You should use a global named constant to deal with maximum number of values. You must utilize some modules/functions in your program and the following modules/functions should be incorporated in your program. However, the seven modules/functions in bold are required for the project (i.e., you must have at least five required modules/functions to get full credit). In general, it does not make sense to print a result in a Math-like function (a function that calculates a value such as average) so it just returns a value and let the caller handles the result. It doesn't make sense to print in a sort module either because its main job is to sort a list of values. You must use the same printList() module to print both the original array and the sorted array (call twice from main). We assume that an array is automatically passed by reference so "Ref is not included when designing modules/functions. Display menu and return a valid option Function Integer getMenuOption() Input a list of values from keyboard Module inputList(Real arr). Integer Ref count) Input a list of values from a file Module inputListFile(Real arr], Integer Ref count) Print a list of values in an array with specified values per line Module printList(Real arr. Integer n, Integer valuesPerLine) Sort a list of values in descending order (pick one sorting algorithm) Module sortDescending (Real arr], Integer n) Compute an average for a list of values Function Real averageList(Real arr. Integer n) Compute standard deviation for a list of values Function Real stdDeviation (Real arr. Integer n) Compute median for a sorted list of values Function Real medianSorted List(Real arr]. Integer n) Print all statistics Module printStats(Real max, Real ave, Real med, Real std) You must follow the format below for the user-interface of your program (sample output for some test cases): [Your Name]'s Statistical Calculator Program Menu 1. Use stored data 2. Input data from keyboard 3. Input data from a file 4. Quit Enter your selection -->1 There are 3 values in the data set. Original list: 73.3 83.4 58.0 Descending list: 83.4 73.3 58.0 Maximum: 83.4 Average: 71.6 Median: 73.3 Std Deviation: 12.8 Program Menu 1. Use stored data 2. Input data from keyboard 3. Input data from a file 4. Quit Enter your selection -->>2 Enter one value at a time (at least 3 and up to 20). You must enter valid data or program will not work. Enter -1 to signal end of data (-1 or -1.0). Please enter a value -> 73.3 Please enter a value -> 83.4 Please enter a value --> 58 Please enter a value -> 11.9 Please enter a value-> 25.1 Please enter a value -> 69.9 Please enter a value-> 45.7 Please enter a value -> 95.0 Please enter a value -> 44.4 Please enter a value->-1 There are 9 values in the data set. Original list: 73.3 83.4 58.0 11.9 25.1 69.9 45.7 95.0 44.4 Descending list: 95.0 83.4 73.3 69.9 58.0 45.7 44.4 25.1 11.9
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
![Maximum: 95.0
Average: 56.3
Median:
58.0
Std Deviation: 27.2
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection -->3<Enter>
Enter the name of the file-->p2Input.txt<Enter>
There are 20 values in the data set.
Original list:
73.3 99.0 83.4 58.0 25.1
69.0 11.9 95.0 74.8 55.0
43.5 47.4 95.6 58.9 52.6
37.7 93.8 19.9 23.9 77.2
Descending list:
99.0 95.6 95.0 93.8 83.4 77.2
74.8 73.3 69.0 58.9 58.0 55.0
52.6 47.4 43.5 37.7 25.1 23.9
19.9 11.9
Maximum: 99.0
Average: 59.8
Median:
58.5
Std Deviation: 27.1
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection --> 5<Enter>
Invalid selection
Enter your selection -->4<Enter>
Thanks for using my statistical calculator.
Additional Requirements: Do not use global variables in your program. Sample standard deviation is required for this program. Provide only one median. Print real values with one digit after the decimal
place and line up values properly.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1f537654-8d0a-424b-9fe0-9d9b30435d57%2Fc0800fe0-bf8c-46da-a73b-dc275fb80127%2F2vnm72o_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Maximum: 95.0
Average: 56.3
Median:
58.0
Std Deviation: 27.2
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection -->3<Enter>
Enter the name of the file-->p2Input.txt<Enter>
There are 20 values in the data set.
Original list:
73.3 99.0 83.4 58.0 25.1
69.0 11.9 95.0 74.8 55.0
43.5 47.4 95.6 58.9 52.6
37.7 93.8 19.9 23.9 77.2
Descending list:
99.0 95.6 95.0 93.8 83.4 77.2
74.8 73.3 69.0 58.9 58.0 55.0
52.6 47.4 43.5 37.7 25.1 23.9
19.9 11.9
Maximum: 99.0
Average: 59.8
Median:
58.5
Std Deviation: 27.1
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection --> 5<Enter>
Invalid selection
Enter your selection -->4<Enter>
Thanks for using my statistical calculator.
Additional Requirements: Do not use global variables in your program. Sample standard deviation is required for this program. Provide only one median. Print real values with one digit after the decimal
place and line up values properly.
![MUST BE WRITTEN IN C++
Write a program so that user can use it to compute and display various statistics for a list of at least 3 values and up to 20 positive real values. The main objectives of this project are to work with menu,
arrays, file input, and modules/functions. A menu is available and user can select one of the 4 options from the menu. The program will continue until option 4 is selected. For option 1, process a predefined
array in the code with 3 values (73.3 83.4 58.0). User will be able to input an array from the keyboard with a sentinel loop with option 2. Use the following values (73.3 83.4 58.0 11.9 25.1 69.9 45.7 95.0
44.4)as one of your test cases (use-1.0 as a sentinel value). When option 3 is selected, input data from a text file. Use the given p2input.txt Download p2input.txt as a test case. The values in the file are
shown below.
73.399.0 83.4 58.0 25.1 69.0 11.9 95.0 74.8 55.0
43.5 47.4 95.6 58.9 52.6 37.7 93.8 19.9 23.9 77.2
You can assume that the user will provide a list of valid values (i.e., valid values, provide a list with at least 3 values and will not exceed the maximum number of values). After receiving a list of values via
one of the options, your program shall display the original array with maximum 5 values per line, sorted array in descending order with maximum 6 values per line, maximum, average, median (only one
median value is needed; need to deal with odd or even list), and sample standard deviation in a readable format using one digit after the decimal place. The sample standard deviation formula, is
s={i=1N(xi-x N-1, where xi is the ith element in a list, x is the average of the values in the list, N is the number of values in the list, and s is the sample standard deviation. If you need assistance with this
formula, please ask. Make sure to come up with a solid design before attempting your code on the computer. You should use a global named constant to deal with maximum number of values.
You must utilize some modules/functions in your program and the following modules/functions should be incorporated in your program. However, the seven modules/functions in bold are required for the
project (i.e., you must have at least five required modules/functions to get full credit). In general, it does not make sense to print a result in a Math-like function (a function that calculates a value such as
average) so it just returns a value and let the caller handles the result. It doesn't make sense to print in a sort module either because its main job is to sort a list of values. You must use the same printList()
module to print both the original array and the sorted array (call twice from main). We assume that an array is automatically passed by reference so "Ref is not included when designing modules/functions.
Display menu and return a valid option
Function Integer getMenuOption()
Input a list of values from keyboard
Module inputList(Real arr. Integer Ref count)
Input a list of values from a file
Module inputListFile(Real arr[], Integer Ref count)
Print a list of values in an array with specified values per line
Module printList(Real arr[], Integer n, Integer valuesPerLine)
Sort a list of values in descending order (pick one sorting algorithm)
Module sortDescending (Real arr[], Integer n)
Compute an average for a list of values
Function Real averageList(Real arr[], Integer n)
Compute standard deviation for a list of values
Function Real stdDeviation (Real arr[], Integer n)
Compute median for a sorted list of values
Function Real medianSorted List(Real arr[], Integer n)
Print all statistics
Module printStats (Real max, Real ave, Real med, Real std)
You must follow the format below for the user-interface of your program (sample output for some test cases):
[Your Name]'s Statistical Calculator
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection -->1<Enter>
There are 3 values in the data set.
Original list:
73.3 83.4 58.0
Descending list:
83.4 73.3 58.0
Maximum: 83.4
Average: 71.6
Median:
73.3
Std Deviation: 12.8
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection -->2<Enter>
Enter one value at a time (at least 3 and up to 20).
You must enter valid data or program will not work.
Enter -1 to signal end of data (-1 or -1.0).
Please enter a value -> 73.3<Enter>
Please enter a value ->83.4<Enter>
Please enter a value --> 58<Enter>
Please enter a value -> 11.9<Enter>
Please enter a value --> 25.1<Enter>
Please enter a value --> 69.9<Enter>
Please enter a value --> 45.7<Enter>
Please enter a value --> 95.0<Enter>
Please enter a value -> 44.4<Enter>
Please enter a value -->-1<Enter>
There are 9 values in the data set.
Original list:
73.3 83.4 58.0 11.9 25.1
69.9 45.7 95.0 44.4
Descending list:
95.0 83.4 73.3 69.9 58.0 45.7
44.4 25.1 11.9](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1f537654-8d0a-424b-9fe0-9d9b30435d57%2Fc0800fe0-bf8c-46da-a73b-dc275fb80127%2F7v9pk4_processed.jpeg&w=3840&q=75)
Transcribed Image Text:MUST BE WRITTEN IN C++
Write a program so that user can use it to compute and display various statistics for a list of at least 3 values and up to 20 positive real values. The main objectives of this project are to work with menu,
arrays, file input, and modules/functions. A menu is available and user can select one of the 4 options from the menu. The program will continue until option 4 is selected. For option 1, process a predefined
array in the code with 3 values (73.3 83.4 58.0). User will be able to input an array from the keyboard with a sentinel loop with option 2. Use the following values (73.3 83.4 58.0 11.9 25.1 69.9 45.7 95.0
44.4)as one of your test cases (use-1.0 as a sentinel value). When option 3 is selected, input data from a text file. Use the given p2input.txt Download p2input.txt as a test case. The values in the file are
shown below.
73.399.0 83.4 58.0 25.1 69.0 11.9 95.0 74.8 55.0
43.5 47.4 95.6 58.9 52.6 37.7 93.8 19.9 23.9 77.2
You can assume that the user will provide a list of valid values (i.e., valid values, provide a list with at least 3 values and will not exceed the maximum number of values). After receiving a list of values via
one of the options, your program shall display the original array with maximum 5 values per line, sorted array in descending order with maximum 6 values per line, maximum, average, median (only one
median value is needed; need to deal with odd or even list), and sample standard deviation in a readable format using one digit after the decimal place. The sample standard deviation formula, is
s={i=1N(xi-x N-1, where xi is the ith element in a list, x is the average of the values in the list, N is the number of values in the list, and s is the sample standard deviation. If you need assistance with this
formula, please ask. Make sure to come up with a solid design before attempting your code on the computer. You should use a global named constant to deal with maximum number of values.
You must utilize some modules/functions in your program and the following modules/functions should be incorporated in your program. However, the seven modules/functions in bold are required for the
project (i.e., you must have at least five required modules/functions to get full credit). In general, it does not make sense to print a result in a Math-like function (a function that calculates a value such as
average) so it just returns a value and let the caller handles the result. It doesn't make sense to print in a sort module either because its main job is to sort a list of values. You must use the same printList()
module to print both the original array and the sorted array (call twice from main). We assume that an array is automatically passed by reference so "Ref is not included when designing modules/functions.
Display menu and return a valid option
Function Integer getMenuOption()
Input a list of values from keyboard
Module inputList(Real arr. Integer Ref count)
Input a list of values from a file
Module inputListFile(Real arr[], Integer Ref count)
Print a list of values in an array with specified values per line
Module printList(Real arr[], Integer n, Integer valuesPerLine)
Sort a list of values in descending order (pick one sorting algorithm)
Module sortDescending (Real arr[], Integer n)
Compute an average for a list of values
Function Real averageList(Real arr[], Integer n)
Compute standard deviation for a list of values
Function Real stdDeviation (Real arr[], Integer n)
Compute median for a sorted list of values
Function Real medianSorted List(Real arr[], Integer n)
Print all statistics
Module printStats (Real max, Real ave, Real med, Real std)
You must follow the format below for the user-interface of your program (sample output for some test cases):
[Your Name]'s Statistical Calculator
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection -->1<Enter>
There are 3 values in the data set.
Original list:
73.3 83.4 58.0
Descending list:
83.4 73.3 58.0
Maximum: 83.4
Average: 71.6
Median:
73.3
Std Deviation: 12.8
Program Menu
1. Use stored data
2. Input data from keyboard
3. Input data from a file
4. Quit
Enter your selection -->2<Enter>
Enter one value at a time (at least 3 and up to 20).
You must enter valid data or program will not work.
Enter -1 to signal end of data (-1 or -1.0).
Please enter a value -> 73.3<Enter>
Please enter a value ->83.4<Enter>
Please enter a value --> 58<Enter>
Please enter a value -> 11.9<Enter>
Please enter a value --> 25.1<Enter>
Please enter a value --> 69.9<Enter>
Please enter a value --> 45.7<Enter>
Please enter a value --> 95.0<Enter>
Please enter a value -> 44.4<Enter>
Please enter a value -->-1<Enter>
There are 9 values in the data set.
Original list:
73.3 83.4 58.0 11.9 25.1
69.9 45.7 95.0 44.4
Descending list:
95.0 83.4 73.3 69.9 58.0 45.7
44.4 25.1 11.9
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 9 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education