Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A multiple-choice quiz has a total of 15 questions. Each question can either be: A, B, C, D, E (five choices). All data for that

A multiple-choice quiz has a total of 15 questions. Each question can either be: A, B, C, D, E (five choices). All data for that exam is stored in a file quiz.txt. The first line of data contains the correct answers to the 15 questions in the first 15 consecutive character positions.

For Example: ABBCBBEDCEDBCCA

Each line in the file contains the answers for an individual student. Data on a line consists of a student ID (integer), then by a space, followed by the 15 answers given by the student in the next 15 consecutive character positions. An X is used if the student did not answer one of the questions.

For example: 1225 ADBCXCXECAXABCA

There is no limit to how many students there are. A line containing a studentID 0 indicates the end of the data.

A students overall total score is calculated by adding up points. Points for a question are calculated as shown: Correct answer = 5 points, wrong answer = -2 points, no answer = 0 points

.

Write a C program that prints:

1. Each student ID and there overall total score

2. The total number of students

3. The number of correct responses to each of the 15 questions individually(example:

Question Number: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Number correct: 5 8 2 9 8 5 3 2 8 4 9 4 6 7 9

Hint: For loop's and three array's must be used. Basic program for beginners.

Use appropriate variable names (example: int correct=0, wrong=0, noattempted=0, char answers[16], char studentanswers[16], char correctnumberanswers[15], etc.)

.

Sample data in quiz.txt

ABEDEEBCEABBCCA

4564 ABEXXBXECDDCBAA

2216 ABEDEEBXXEDEACA

8532 BBEEEBXECDDCBAA

5829 ABEEABEECDDCBAA

7721 CBEXBBXECDDCBXX

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago