Iterators act a lot like pointers so if a function asks for iterators, if you are dealing with an array, just give it pointers to the first and (one after) last elements.
I will try this. I have added a scoring feature into the quiz. It adds 1 mark for correct, deducts 0.5 for incorrect and does nothing for skipping the question[at least in the previous version there was an option to skip]. I tried to add the condition that if the user inputs 0, the program would give the output
You skipped the question
and continue to the next question. But it gives e an error message when I try to skip a question.
I modified the function to:
Here, correct, wrong, divider and skip are strings made by me and I have checked that they are working.
The error is similar to the one I gave when I tried to use the rand incorrectly.
Any help?
Is the list in the program the array? that I must use, or do I have to create another one?
Another thing: I had used Single Quotation Marks['x'] in the questions, but the first quotation mark is the closing quotation mark [pointing to the down and left]. Any way to correct this?
But what about the quotation marks? If I put something in quotation marks like
'tree'
, what I get is
’tree’
Any way to solve that?
And i shuffled the array. But the problem persists. Say I put 50 questions and call for 40 of them. I am getting some of the questions twice, and sometimes even thrice.
By the way, only want any 10 [or any other number] of questions to be printed in the program, so simply shuffling wouldn't work. And even if I did that, the quiz would become too long.