
- Forum
- Programming Talk
- C and C++
- i Need help with this program plzzzz
i Need help with this program plzzzz
This is a discussion on i Need help with this program plzzzz within the C and C++ forums, part of the Programming Talk category; Use structure to hold a candidate’s data. A multiple-choice examination consists of twenty-five questions. Each question has five choices, labeled ...
-
i Need help with this program plzzzz
Use structure to hold a candidate’s data.
A multiple-choice examination consists of twenty-five questions. Each question has five choices, labeled A, B, C, D and E. The first line of data contains the correct answers to the twenty-five questions in the first 25 consecutive character positions, for example:
ABCDABCDABCDABCDABCDABCDA
Each subsequent line contains the answers for a candidate. Data on a line consists of a candidate number (an integer), followed by one or more spaces, followed by the twenty five answers given by the candidate in the next twenty five consecutive character positions. A space is used if a candidate did not answer a particular question. You may assume all data are valid and stored in a file exam.txt. A sample line is:
N0001 ABCDABCDABCDABCDAB DABCDA
There are at most 30 candidates. A line containing a “candidate number” 0 only indicates the end of the data.
Points for a question are awarded as follows: correct answer: 5 points; wrong answer: 0 points; no answer: 0 points.
Write a program using the below input to process the data and print a report consisting of candidate number and the total points obtained by the candidate, in descending order by candidate number. At the end, print the average number of points gained by the candidates. You must use at least two functions: one to print the results and one to calculate the total points.
N0000 ABCDABCDABCDABCDABCDABCDA
N0001 ABCDBACDCDABABDC DCDABCDD
N0010 ABDCBBCDAD C BDDBDCBADCAA
N0011 ABCDABCDABCDABCDABCDABCDA
N0100 ABCDABC ABCDA CDABCDABCDA
-
Sure I can help you with this program. However you must give the program and explain where you are struck to help you.
«
paper for campus
|
Is it Unique
»

Reply With Quote





