int num ; while(i>=5 && i<=8 && wrongcount <4) { i++; //get random numbers largest = 1 + randobj.nextInt(25); smallest = 2 + randobj.nextInt(9); correct_ans = largest - smallest; incorrect_ans = 1 + randobj.nextInt(35); while(correct_ans == incorrect_ans) { incorrect_ans = 1 + randobj.nextInt(35); } if(i == 1) { //getting the largest and smallest number largest = num1; smallest = num2; } else { if(num1 > largest) { largest = num1; } if(num2 > smallest) { smallest = num2; } } //indicate the round and level would be starting from System.out.println(playername+" round 2 "+" level "+ i +" match the letter with the correct answer"); System.out.println(playername+" please subtract "+ largest + " - "+smallest); System.out.println("A:"+correct_ans); System.out.println("B:"+incorrect_ans); uSelect = reader.next().charAt(0); if(uSelect == 'A' || uSelect == 'a') { System.out.println(playername+"awwwwsome, well done, answer is correct, you are doing good, keep up the good work"); totalscore +=350; System.out.println("round 2"); System.out.println("level "+ i); totalscore +=score; System.out.println("total score it"+totalscore); } else { while(uSelect != 'A' && uSelect != 'a' & wrongcount < 4) { System.out.println(playername+" awww come on now wrong answer, let's do this again "); totalscore -=175; System.out.println("round 2"); System.out.println("level "+ i); totalscore -=score; System.out.println("total score:"+totalscore); if(wrongcount <4) { System.out.println(playername+" round 2 "+ "level "+ i+" match the letter with the correct answer"); System.out.println(playername+" please subtract "+ largest + " - "+ smallest); System.out.println("A:"+correct_ans); System.out.println("B:"+incorrect_ans); uSelect = reader.next().charAt(0); } } } } System.out.println("\n*******************welcome to round***3*divide**round****************************"); while(i>=9 && i<=10 && wrongcount < 4) { i++; //get random numbers numerator = 1 + randobj.nextInt(25); denominator = 2 + randobj.nextInt(9); numvalue = 1 + randobj.nextInt(25); numvalue2 = 2 + randobj.nextInt(9); correct_ans = numerator = denominator * numvalue2; correct_ans = numerator / denominator; incorrect_ans = 1 + randobj.nextInt(35); while(correct_ans == incorrect_ans) { incorrect_ans = 1 + randobj.nextInt(35); } System.out.println(playername+" you are on round 3 "+" level "+ i + " match the letter with the correct answer"); System.out.println(playername+" please divide "+ numerator + " / "+ denominator); System.out.println("A:"+incorrect_ans); System.out.println("B:"+correct_ans); uSelect = reader.next().charAt(0); if(uSelect == 'B' || uSelect == 'b') { System.out.println(playername+" hey that's great, correct is right, keep up the good worl"); totalscore +=350; System.out.println("round 3"); System.out.println("level "+ i); totalscore +=score; System.out.println("total score:"+totalscore); } else { while(uSelect !='B' && uSelect !='b' && wrongcount < 4) { System.out.println(playername+" tsk, tsk, nice bangbang!!! that is wrong, please try again, kiddooo!!!"); totalscore -=175; System.out.println("round 3"); System.out.println("level "+ i); totalscore -=score; System.out.println("total score: "+totalscore); } } } while(wrongcount < 4) { System.out.println(playername+" you are on round 3 "+ " level "+ i + " match the letter with the correct answer"); System.out.println(playername+" please divide "+ numerator + " / "+ denominator); System.out.println("A:"+incorrect_ans); System.out.println("B:"+correct_ans); uSelect = reader.next().charAt(0); } } else { System.out.println(playername+"that is not a valid character"); System.exit(0)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)