A
Ajoy K Thamattoor
BabyBoo24 said:I must create ten multiple choice questions.The questions will be weighted
Question1: 10.0 points question2: 15.0 points, etc. Each question has
different weights. The weights must be defined as constants. After the
user enters an answer the program must go to the next question. At the
end of the program I need to output the number of questions answered
correctly, a letter and numerical grade. How do I store the users answer
and calculate the numerical grade? Please Help Asap
First you need to choose your data structure. You'll need one
which can store:
The question
The weight
The real answer
The user's answer
Once you have this, use the C I/O functions to display the
questions, and get the answers. At the end, run through the data
structure and use a comparison function (probably
based on a C string comparison function) to determine if the answer
is correct. Accumulate the number of correct answers and calculate the
numerical grade and letter grade according to the grading formula.
Ajoy