Using C Language write a program: 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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question

Using C Language write a program:

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.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning