subject

C++ You should attempt this assignment after we cover using pointers with arrays and dynamic memory allocation. There is a tutorial for this assignment since it is the first time we are using pointers
Note: You must use pointer /offset notation in this assignment instead of array notation. For example:
If you have an array named a, to access it content under subscript 3, you must write:
*(a + 3) instead of a[3]. Please note that points will be deducted if this requirements is not followed.
Movie Statistics
Write a program that can be used to gather statistical data about the number of movies college students see in a month. The program should perform the following steps:
1. Ask the user how many students were surveyed. An array of integers with this many elements should then be dynamically allocated.
2. Allow the user to enter the number of movies each student saw into the array.
3. Calculate and display the average, median, and mode of the values entered. Input validation: Do not accept negative numbers for input:
Median Function
In statistics, when a set of values is sorted in ascending and descending order, its median is the middle value. If the set contains an even number of values the median is the mean (or average) of the two middle values. The function should accept an array of integers and the size of the array. The median value should be returned as a double.
To demonstrate your pointer powers, use pointer notation instead array notation in this function.
Mode Function In statistics
The mode of set of values is the value that occurs most often or with the greatest frequency. This function should accept an array of integers and the size of the array (integer). The function should determine the mode of the array. That is, it should determine which value in the array occurs most often. The mode is the value the function should return. If the array has no mode, (none of the values occur more than once), the function should return -1.
Average Function
We have written functions like that before. It should return a double value that is the average of the array elements. To demonstrate your pointer powers, use pointer notation instead array notation in this function.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
Write a program that displays the following menu: geometry calculator 1. calculate the area of a circle 2. calculate the area of a rectangle 3. calculate the area of a triangle 4. quit enter your choice (1-4): if the user enters 1, the program should ask for the radius of the circle and then display its area. use the following formula: area = ď€(the square of r) use 3.14159 for ď€ and the radius of the circle for r. if the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. use the following formula: area = length * width if the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. use the following formula: area = base * height * .5 if the user enters 4, the program should end. input validation: display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. note: if the user enters an improper menu choice (1-4), the program prints "the valid choices are 1 through 4. run the program again and select one of those." if the user enters a negative radius, the program prints "the radius can not be less than zero." if the user enters a negative value for height or base, the program prints "only enter positive values for base and height."
Answers: 1
You know the right answer?
C++ You should attempt this assignment after we cover using pointers with arrays and dynamic memory...
Questions
question
Mathematics, 26.11.2019 06:31
question
Mathematics, 26.11.2019 06:31
Questions on the website: 13722363