Grading the students performance.

4 visualizaciones (últimos 30 días)
RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH el 13 de Nov. de 2014
Comentada: RITTIK KUMAR GHOSH el 15 de Nov. de 2014
Given the correct key in the form of an array correct_key='.........'; write a program to evaluate the grade of a student from the answer key. use -1 if answer is wrong, 10 if answer is correct and 0 if no answer.
  1 comentario
RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH el 13 de Nov. de 2014
being more specific, there were total of 8 questions carrying 10 marks for a correct answer and -1 for wrong answer and 0 for an unattended question. how to evaluate it?

Iniciar sesión para comentar.

Respuesta aceptada

MA
MA el 13 de Nov. de 2014
%w=wrong
%c=correct
%o=unanswered
syms w c o
s=0;
for i=1:5
g(i)=input('answer= ');
if g(i)==w
s=s-1;
elseif g(i)==c
s=s+10;
elseif g(i)==o
s=s+0;
end
end
display('grade')
display(s)
  4 comentarios
RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH el 14 de Nov. de 2014
thanks
MA
MA el 14 de Nov. de 2014
you're welcome

Iniciar sesión para comentar.

Más respuestas (1)

RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH el 14 de Nov. de 2014
1.When I am putting in the answers as 10 0 -1 10 10, the grade remains the same in each case, it is not changing and showing the result 0. why is it so? 2.Why there are 2 spaces in this script('answer= ') can you please explain?
  4 comentarios
RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH el 14 de Nov. de 2014
then I tried out with the numerical inputs and every time it is s=0
RITTIK KUMAR GHOSH
RITTIK KUMAR GHOSH el 15 de Nov. de 2014
thanks for all the help, got it correct

Iniciar sesión para comentar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by