0

do anyone have example how this is done

Define the array that is the result of the exam seven students who took the subject of Web services and have won 77, 98, 56, 87, 64, 55, 82 points. Print all of the results, the minimum and maximum number of points, compute the average winning score per student.

I am confused at min and max number of points, that is 100 right? so I need to count avarage number for example of 77 in percents or what, from 0 to 100, what avarage number, 77 is only number that student won

or I might need to set min and max from those numbers, but what next, its not avarage of all students together, but for every single student, student that won 77 points what is avarage for that, its 77

Edited by filipgothic

4
Contributors
6
Replies
35
Views
3 Years
Discussion Span
Last Post by urtrivedi
0

I think that too, but what is goal, am confused about avarage stuff, it says avarage number per student, not avarage number of all students together

0

The min and max I assume would be from your sample. The average is just the sum of all values divided by the number of values - whether it is for all students or in the case of a single student, you would need all his/her values - which you do not specify. If you don't know which you need, I hardly think that we're in a position to tell you.

$points = array(7, 98, 56, 87, 64, 55, 82);
$min = min($points);
$max = max($points);
$ave = array_sum($points)/count($points); // you can format this with number_format()

Is that it?

0

all I know is in that text, I guess I need to print array from min to max like

55
56
64
...

but idk what next, avarage number can be choosed from all numbers together, but not for single one

1

ordering values in an array can be done with sort()

but idk what next, avarage number can be choosed from all numbers together, but not for single one

This has got the smell of an assignment to it. If it is, perhaps you should ask? Second guessing is pointless.

Edited by diafol

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.