Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7504803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:41:42+00:00 2026-05-29T21:41:42+00:00

im writing a quiz program. if the user is wrong the 1st time, he

  • 0

im writing a quiz program. if the user is wrong the 1st time, he can choose to get a 2nd try, which i must display by blanking out his original choice, so instead of ABCD he only sees AB D or something. If you got an idea or can post a link id appreciate it . ive marked the problem area with // below.

int player_try (string questions[][5], char answers[]  )
{
char user_guess;
int m = 0;
srand(time(NULL));
int x;
int choice;
int total = 1;
int score = 0;

for (m=0; m<6; m++)
     {

    x = (rand() % 7);
    cout << user_name << ": Here is question number " << m+1 << endl;
    cout << m+1 << ". " << questions[x][0]<< endl;
    cout << "A. " << questions[x][1]<< endl;
    cout << "B. " << questions[x][2]<< endl;
    cout << "C. " << questions[x][3]<< endl;
    cout << "D. " << questions[x][4]<< endl;
    cin >> user_guess;
    user_guess = toupper(user_guess);

    while (!(user_guess >= 'A' && user_guess <= 'D'))
            {
            cout << "Please choose a valid answer.";
            cin>> user_guess;
            user_guess = toupper(user_guess);
        }
    if (user_guess != answers[x])
            {
            cout <<"Wrong!" <<endl;
                cout << "Skip this question or try again?" << endl;
            cout << "If you are wrong again... game OVER! No points!" << endl;
                cout << "Press 1 to skip, press 2 to take a chance at greatness." << endl;
            cin  >> choice;
                if (choice == '1')
                {
                            cout << "we shall skip this question." << endl;
                    break;
                }
                else
                {
                 cout << "I applaud your bravery." << endl;
                 cout << user_name << ": Here is question number " << m+1 << endl;
                     cout << m+1 << ". " << questions[x][0]<< endl;
                     cout << "A. " << questions[x][1]<< endl;  // here is where im stuck
                     cout << "B. " << questions[x][2]<< endl;  // how do i blank out an incorrect choice?
                     cout << "C. " << questions[x][3]<< endl; //thanks
                     cout << "D. " << questions[x][4]<< endl;
                     cin >> user_guess;
                     user_guess = toupper(user_guess);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:41:44+00:00Added an answer on May 29, 2026 at 9:41 pm

    I agree with Chad.

    If you want a simple way to handle it, store the answer given in a variable, then add some checks to see if this answer you are writing is the same as already answered, and skip it if they are the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ASP.NET MVC noob here I was writing a quiz application where a user can
I'm currently writing something of a quiz program. This program throws questions at the
I'm writing a quiz program. I have a 1-Dimensional array of correct answers from
Quiz question: What is the output of running the following program: Sub Main() Try
I'm writing a quiz program using PHP and a bit of Javascript. The questions
Writing the code for the user authentication portion of a web site (including account
Writing a python program, and I came up with this error while using the
I'm writing this application that will allow a user to define custom quizzes and
Writing code in PHP, how can I ensure the require_once path of a script
I'm writing a quiz application using php / jquery. The answer selections are contained

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.