Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5. You want to automate grading the multiple choice part of an exam, and the ans

ID: 3719892 • Letter: 5

Question

5. You want to automate grading the multiple choice part of an exam, and the answers are in a file. Open the open file test3_Answers.txt, using the file handle inFile. Populate an array called test3Answers which will contain the correct answers to the test questions. You may assume one answer on each line of the input file. Next, determine the number of questions student1 has gotten correct, and whether or not he/she passed the exam. A passing grade is any score 21 or greater (60%). student! = {A','B','D,,'D', ‘D,,'C','c','A','B,,'B','C','A,, . . ., A','A, ‘D'); index = 1; %index used to populate test3Answers test3Answers = { }; correct0; while feof(inFile) oneGrade fgetl(in File); %populate test3Answers array

Explanation / Answer

Solution:

code:

stdents={'A','B','D','D','D','C','C','A','B','B','C','A','A','A','D'};
theIndex=1;
test3answers={};
correct=0;
while~feof(inFile)
> test3answers(index)=oneGrade;
end

for i=1:size(test3answers, 2)
if(test3answers(i)==students(i))
correct= correct+1;
end
end


if(correct>=21)
fprintf('passed')
else
fprintf('end')
end

fifty=zeros(1,50);
for i=1:235
num=randi(50);
fifty(num)=fifty(num)+1;
end

display(fifty)

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote