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

  • Home
  • SEARCH
  • 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 8713109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:15:47+00:00 2026-06-13T05:15:47+00:00

I’m new to C# programming so I need to ask C# experts here, what

  • 0

I’m new to C# programming so I need to ask C# experts here, what techniques should I use for a quiz game application I’m planning to develop. I’d like my quiz app to be like this:

1.) What is the capital city of UK?
a. London
b. Washington D.C.
c. Tokyo
d. Manila

2.) What is the capital city of Russia?
a. Bangkok
b. Beijing
c. Islamabad
d. Moscow

ETC….

I want the questions to be randomly generated using Rand(). The questions should be randomly placed, not in the order I set up here, but still those 4 choices I declared are the only ones to display in the set of the quiz. If you have any links to tutorials please give me so I can study it. I really love to develop this app, but I don’t have any clue to start this. Any help is truly appreciated. Thanks!

  • 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-06-13T05:15:49+00:00Added an answer on June 13, 2026 at 5:15 am

    First you should understand your problem. Just check your requirements and think of objects. You certainly have “question” and “answers”. Each Question has 4 possible answers and only one is correct. So a first, very simple approach would look like that.

    class Question
    {
        public string QuestionText{ get; set; }
        public string AnswerA { get;set }
        public string AnswerB { get;set }
        public string AnswerC { get;set }
        public string AnswerD { get;set }
    }
    

    This is a good start, but not perfect. You could now store the correct answer aswell inside this question object. But to use this new property to its fullest, it would make sense to make our answers a bit more dynamic.

    class Question
    {
        public Question()
        {
            Answers = new string[4];
        }
        public string QuestionText{ get; set; }
        public string[] Answers { get;set; }
        public int CorrectAnswer {get;set; }
    }
    

    So with this small object we can now create all our questions like this:

    var question = new Question();
    question.QuestionText = "What color is snow?";
    question.Answers[0] = "Red";
    question.Answers[1] = "Yellow";
    question.Answers[2] = "White";
    question.Answers[3] = "Green";
    question.CorrectAnswer = 2;
    
    // ... more questions
    
    var listOfQuestions = new List<Question>();
    listOfQuestions.Add(question);
    

    How to sort randomly is another topic which is not difficult to find here on SO.

    I personaly like icemaninds idea, you can use his answer to improve my basic approach.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.