Helping with Code
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Helping with Code

  1. #1
    Join Date
    Jan 2018
    Posts
    1

    Helping with Code

    Please Help me with this question as I am a beginner and my professor thinks I can do this while I have no clue how to do this:

    1. Starting with Player 1, each player gets a turn answering 5 trivia questions (there are 10-questions, 5 for each player). When a question is displayed, four possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point.

    2. After answers have been selected for all of the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner.

    You are to design a class called Question to hold the data for a trivia question.
    The Question class should have String fields for the following data:

    A trivia question
    Possible answer-1
    Possible answer-2
    Possible answer-3
    Possible answer-4
    The number of the correct answers (1, 2, 3, or 4)

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,783

    Re: Helping with Code

    Norm

  3. #3
    Join Date
    Mar 2018
    Posts
    1

    Re: Helping with Code

    Create an int variable to hold points and use if..else statement (you can read more at https://docs.oracle.com/javase/tutor...dbolts/if.html or https://www.peopleperhour.com/freela...mming+homework) to check for the correct answer and to add points...and use scanner to gather answers form the console (you can read more at https://docs.oracle.com/javase/7/doc...l/Scanner.html or http://yourhomeworkhelp.org/do-my-java-homework/)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)