Computers and Technology
Computers and Technology, 08.07.2021 21:20, Akira8889

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:10, witerose701
Write a function so that the main0 code below can be replaced by the simpler code that calls function mphandminutes tomiles0. original main0 int main) l double milesperhour-70.0; double minutestraveled = 100.0; double hourstraveled; double milestraveled; hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; cout < "miles" 2 using namespace std; 4 /* your solution goes here/ 6 int maino 1 test passed 7 double milesperhour 70.0 all tests passed 8 double minutestraveled 100.0; 10 cout < < "miles: " < < mphandminutestomiles(milesper-hour, minutestraveled) < < endl; 12 return 0; 13
Answers: 1
image
Computers and Technology, 23.06.2019 21:50, Trinhphuongtran
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, CarlosParker99
Think of a spreadsheet as a giant calculator spread of paper chart data collector
Answers: 2
image
Computers and Technology, 24.06.2019 13:30, tami5
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. the program should output the average high, average low, and the highest and lowest temper- atures for the year. your program must consist of the following functions: a. function getdata: this function reads and stores data in the two- dimensional array. b. function averagehigh: this function calculates and returns the average high temperature for the year. c. function averagelow: this function calculates and returns the aver- age low temperature for the year. d. function indexhightemp: this function returns the index of the highest high temperature in the array. e. function indexlowtemp: this function retur
Answers: 3
Do you know the correct answer?
C++ You should attempt this assignment after we cover using pointers with arrays and dynamic memory...

Questions in other subjects:

Konu
Computers and Technology, 19.01.2020 02:31