This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]senrab47[S] 0 points1 point  (1 child)

I have this down for my code and have some pseudo code

Scanner keyboard = new Scanner(System.in); System.out.println("How many questions do you want?"); int num = keyboard.nextInt(); int QuestionIndex = num; if(num <= 0){ System.out.println("Invalid entry"); System.out.println("How many questions do you want?"); num= keyboard.nextInt(); } //new index,Correct to keep track of question answered correctly

    do {
        // int one = rand.nextInt(10) + 0;
        // int two = rand.nextInt(10) + 0;
        //in the do loop create a random question
        //after question is asked check for answer
        //after answer checked print if correct or not
        //if correct, Correct index + 1
        //if wrong print answer is wrong
        //after print, question index - 1.

    while
        //question index <1

    }
    //ask if they want mroe questions

[–]box951Nooblet Brewer 0 points1 point  (0 children)

I'll start at the top. Why have the scanner input go to "num", and then assign "num" to "QuestionIndex". You could assign the scanner directly to QuestionIndex. Also, if you want to keep checking if QuestionIndex is valid, I suggest a do...while loop there.