Site hosted by Angelfire.com: Build your free website today!

Program #12 

 

 

 

 


Write a program that will ask 5 multiple-choice questions.

Have five different topics with four choices per question.

Keep track of the correct responses as you go.  Print out if the person gets the question correct or incorrect.

Print the final score after the questions.  You may select any 5 topics.  For example, you could ask questions from math, science, history of C++, U.S. history, geography or…?

You need a counter to keep track of correct answers.  Before the questions set it equal to zero.  Then, on the ‘if’ statement, increment it if it’s correct. (correct++;)

 

Your program should look like this…

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


HINTS:

            Correct=0;

            cout<<”Question #1\n Who first climbed Mt. Everest?”<<endl;

cout<<” a) Ricky Ricardo \n b) Ricky Martin \n c) Edmund Hillary \n d) Edmund Muskie”<<endl;

            cin>>ch;

            if (ch == ‘a’) cout<<”no, he married Lucy”<<endl;

            if (ch == ‘c’){

cout<<”yes, you are correct.”<<endl;

                                    correct++;

                                 }

 

//delay between questions.  Use sleep(2); (must #include<dos.h>)

 

Knock on the sky and listen to the sound!

-ZEN SAYING