Multiple Choise Test Program in C++

Hi, I have an assessment due and I would like to ask for some help as I have the foggiest idea about C++ and programming. I got a book, I started reading but I can't find an answer to my problem. Here's the topic.

Essentially the package is a multiple choice test based on 5 questions. Someone taking the test will be given 4 alternatives per question, one will be correct, one will be nearly correct, one will be wrong, one will be obviously wrong.

Once you have developed the code you then need to set 5 questions with (on paper) a solution for the correct answer, why the nearly correct answer is nearly correct, why the wrong answer is wrong and finally why the obviously wrong answer is obviously wrong.

On completion of the test the score should be displayed .
At any point a user can be given the option to end the test.
At the end of the test, a user is given the option to retake the test.

Now, my main concern, my friends, is the main code to display the multiple choice test. I know that I am a bit of pain in the a** cause I don't have any idea but I would be very pleased if someone helped me.

Thanks in advance. Sifis
Write out all the multiple-choice test questions and possible answers, then require the user to input the problem number, a space, and their answer, and press enter (will store data in an array, use cin). Giving an unknown answer will terminate the test and score it.

Just so you know, if you don't already, we do not give out whole answers.

-Albatross
Hi, it's me again. Not to be arrogant, I don't want to do nothing and just take all the help from you. Am not asking for the code just help on what I should use. Some theoretical stuff.
Thanks a lot again. Sifis

P.S.: If anyone see that today and manage to help it would be wonderful!
Sorry about that. It's just that several times I gave out the method rather than the answer, and the person got irritated. If you're above that (and it seems you are), then congratulations!

Alternatively, you may want to implement an "error checker", so that if someone gives an answer that points to an undefined question or answer, then the test will not store the data, but terminate only if the answer is "0 0".

-Albatross
Yes i needed that actually! Thanks!
Sifis
Hey I started building something here but there are two errors. Can you help me found them?
And just to know that won't be the question for my assignment.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>

using namespace std;

int main()
{
    int legs;
    legs = 4


    cout << "Multiple Choise Test on 102CDE Material" << endl;
    cout << "First Question..."; << endl;
    cout << endl;
    cout << "Q1. How many legs an elephant has?" << endl;
    cin >> legs;
    cout << endl;
    if (legs = 4) cout << "Correct!" << endl;
    else cout << "Wrong!" << endl;




    return 0;
}


Thanks. Sifis
You are doing well but line 17 has a common error.

In order to TEST if two values are the same you need '==' rather than just '='. The single '=' is used to set the value. It doesn't compare the values.

Try this:

 
if (legs == 4) cout << "Correct!" << endl;
Last edited on
Well you saved me because i had to do that on 5 more questions and that would be a disaster as that is for my coursework.. Thanks a lot man. Sifis
Topic archived. No new replies allowed.