Homework Help Question & Answers

How to write a matlab program for the following question? Q: 1.Topic:"Automatic Quiz Grading" 2.T...

how to write a matlab program for the following question?

Q:

1.Topic:"Automatic Quiz Grading"

2.The concept is to calculate the student's score in the way of computer scoring.

3.Student's answer (file name: a2.dat)

4.Standard answer (file name: a1.dat)

5. The number of questions are 20

6. all pairs Get +1 point, deduct one option for 1 point

7.calculate the student's grade

0 0
ReportAnswer #1

Assuming that the student attempt each and every question

And let's assume if the student falls in the following category the grade is given as:

Marks Grade

20-15 'A'

14-10 'B'

9-5 'C'

Below 4 'D'

Assuming we have the files

Standard Answer file ----------> a1.dat

Student's Answer file -----------> a2.dat

with answers -------------------------------------------------------.

MATLAB code:

data1 = fileread('a1.dat');

a1 = strsplit(data1);

data2 = fileread('a2.dat');

a2 = strsplit(data2);

correct=0;

total = 20;

for i = 1 : length(a1)

if a1(i) == a2(j)

correct = correct+1;

end

end

incorrect = 20 - correct;

total_score = correct*(1) + incorrect*(-1);

if total_score >=15

disp('A')

elseif total_score >=10 && total_score <=14

disp('B')

elseif total_score >=5 && total_score <=9

disp('C')

else

disp('D')

end

Add Homework Help Answer
Add Answer of:
How to write a matlab program for the following question? Q: 1.Topic:"Automatic Quiz Grading" 2.T...
Your Answer: Your Name: What's your source?
Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Need Online Homework Help?
Ask a Question
Get FREE EXPERT Answers
WITHIN MINUTES