COMP1202 Group Project (Group size : 2) Note: All group members must be from the same lab session Due: Friday 3rd April 2020 at 11:30 pm A multiple-choice examination consists of 20 questions. Each...

1 answer below »
please see the file attached


COMP1202 Group Project (Group size : 2) Note: All group members must be from the same lab session Due: Friday 3rd April 2020 at 11:30 pm A multiple-choice examination consists of 20 questions. Each question has five choices, labeled A, B, C, D and E. All data for that exam is stored in a file exam.txt. The first line of data contains the correct answers to the twenty questions in the first 20 consecutive (one after the other) character positions. For Example: BECDCBAADEBACBEDDBED Each subsequent line in the file contains the answers for a single candidate. Data on a line consists of a candidate number (an integer), then by one or more spaces, followed by the twenty answers given by the candidate in the next 20 consecutive character positions. An X is used if a candidate did not answer a particular question. A sample line is as follows: 5555 BECDCXACCAEDCBEDDACB There can be an unlimited number of candidates. A line containing a “candidate number” 0 indicates the end of the data. A student’s final score is calculated by adding up the points awarded for all the questions. Points for a question are awarded as follows: • Correct answer 4 points • Wrong answer -1 point • No answer 0 points Write a C# program to process the data in the file exam.txt and generate a report that shows: 1. Each candidate number and their final score (the total points obtained by the candidate). 2. The total number of candidates. 3. The number of correct responses to each of the 20 questions. 4. The minimum score attained by a student in the exam. 5. The maximum score attained by a student in the exam. 6. The average score attained by a student in the exam. The report must be written to a file called Report.txt. Required for submission as 2 separate files (do not add the word document to the zip file): 1) A Microsoft word document with a. The names and student numbers of all group members b. The complete code solution pasted into it. 2) You must also compress(zip) your complete solution and upload it to blackboard. The names and id numbers of all group members must be commented at the top of the program One member of each group must be responsible for uploading the “project submission document” containing the C# program code. Sample data that can be in the file exam.txt: Sample program output: (Note the output below does not match the sample file above and is purely for possible layout of information and does not have the additional minimum, maximum and average score.) BACCDEABCEEDCDABBAED 6734 BXCCDAABCEEDCDACBAED 7843 BADCXAABCEXXCDABBAED 2223 BCBAEACCDAEDCDABBAEA 2324 BACXDEABCEEDCDAABAED 3474 BACCDEABCEEDCDABBAED 3434 XADCDAABCEEDCDABBAED 6374 XXXXXCXXXXXXXXXXXAED 3332 BADCDEABCEEDCDADBCEX 3454 BACCXEABCEEDCXABBAED 0
Answered Same DayMar 26, 2021

Answer To: COMP1202 Group Project (Group size : 2) Note: All group members must be from the same lab session...

Aditya answered on Mar 27 2021
151 Votes
Code :
using System;
using System.IO;
namespace assingment
{
public class Function
{
public char[] correct_answer;
public int student_number;
public char[] student_answer;
public int score;
public int student_correct_answer = 0;
public int student_wrong_answer = 0;
public int student_no_answer = 0;
public int[] student_correct_response = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

public void answer(String a)
{
correct_answer = a.ToCharArray();
}
public void newstudent(int x,String y)
{

student_number = x;
student_answer = y.ToCharArray();
calculatescore();
totalscore();
}
public void calculatescore()
{
for (int i =0;i<20;i++)
{
if (correct_answer[i] == student_answer[i])
{
student_correct_answer++;
student_correct_response[i]++;
}
else if (correct_answer[i] != student_answer[i])
{
if (student_answer[i] != 'X')
{
student_wrong_answer++;
}
}
}
}
public void totalscore()
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here