# I need some help with an assignment

• 02-12-2005
AtmaSniper
I need some help with an assignment
I have to create a multiple answer quiz with 10 questions and each question is weighted differently. The quiz taker needs to be able to answer in upper and lower case letters.

One question that I have is how do I keep up with the correct answer and weighted total throughout the entire program and then display it at the end?
• 02-12-2005
AtmaSniper
And thank you for any help.
• 02-12-2005
Quote:

and weighted total throughout the entire
int currentscore = 0;
change the value as needed
Quote:

how do I keep up with the correct answer
If you know about strings and the tolower function this should be easy
Quote:

and then display it at the end?
cout << currentscore << "\n";
• 02-12-2005
7stud
You could put the questions and answers into an array(or two arrays) and then use a for loop to output a question, read in the answer, compare it to the answer in the array, determine the weighted score, and add it to the total score.
• 02-12-2005
AtmaSniper
We haven't gotten into arrays yet. It reads we will need to use int, float, string, char.
• 02-12-2005
andyhunter
Quote:

int currentscore = 0;
change the value as needed
Some psuedocode:

initialize currentscore to 0
input the answer and convert to one case (either upper or lower)
compare with the correct answer
if right add to currentscore the required amount of points
if not dont add anything
continue this block until all questions asked
divide currentscore by total points possible
Multiply result by either 4 (4.0 grading scale) or 100 (100% grading scale)
end program
• 02-12-2005
cerin
I think if you know just a little bit of the language this shouldn't be hard for you. You just need to make a few simple math problems.
• 02-12-2005
AtmaSniper
Thanks for all of your help everyone I met all of the guidelines in the assignment.
• 02-12-2005
AtmaSniper
Yeah cerin that is what I did.
• 02-13-2005
cerin
PPPssstttt....... You probably could have edited your other post.