OUTPUT : LYNNE, your total score is 19 and your average score is 3.8. SAMPLE RUN 2: INPUT : Enter student name : ROSE Enter Answer # 1? 2 Enter Answer # 2? 3 Enter Answer # 3? 7 67 Enter Answer # 4? 5 Enter Answer # 5? 4
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
An instructor gives a multiple choice test which consists of 5 questions, each of which is
answered by a choice of one of the numbers one to five. Write a program to call function TEST
that accepts as input student name and the set of their test answers as one dimensional array.
The program should grade the test. If the student choice is 1 give 1 point. If the choice is 2, give
2 points. 3 points if choice answer is 3 and 4 pints for answer 4 and choice 5 is 5 points.
Otherwise no point is given to other choices. Print out the average score of the student in the
test.
SAMPLE RUN 1:
INPUT : Enter student name : LYNNE
Enter Answer # 1? 2
Enter Answer # 2? 3
Enter Answer # 3? 5
Enter Answer # 4? 5
Enter Answer # 5? 4
OUTPUT : LYNNE, your total score is 19 and your average score is 3.8.
SAMPLE RUN 2:
INPUT : Enter student name : ROSE
Enter Answer # 1? 2
Enter Answer # 2? 3
Enter Answer # 3? 7
67
Enter Answer # 4? 5
Enter Answer # 5? 4
OUTPUT : ROSE, your total score is 14 and your average score is 2.8.
Step by step
Solved in 2 steps