hi danpost
how are you. hope you are in the best of health. well you know i am building my final assignment for programming which is a multiple choice math game this is some of the specification of the game
1. the game supposed to randomized (if you understand what ah mean by randomized)
2 when playing the game, and if the user entered the wrong answered two three times it is supposed to stay on the same level and same round and same number until the user get it right.
3 it should end when the user ran out of chances
4
i have implemented an if and else statement if the game. i put at after the for loop and above the random numbers and now it is just jumping and skipping the whole of round 1 and going on to round two and three. dont know what is the course of that. how can i get it to work for both round 1, 2 and 3. can u look through my codes and tell me where it the logical error because i kno it is there.
any help will be greatly appreciated.
if(playerage < 8 )
{
System.out.println(playername+" you are too young for this game");
System.exit(0);
}
else if( playerage > 13)
{
System.out.println(playername+" you are to old for this game ");
System.exit(0);
}
else
{
System.out.println(playername+" kapow!!!! come let us have fun playing");
}
System.out.println(" ");
System.out.println("***************round 1*********************************");
System.out.println(" ");
for(i = 1; i<=4; i++)
{
if(uSelect == 1) (this is the if else am talking about, if I removed it the code would work, something making it not to work
{
//getting the random numbers
intvalue = 1 + randobj.nextInt(25);
intvalue = 2 + randobj.nextInt(8);
correct_ans = intvalue + intvalue2;
incorrect_ans = 75 + randobj.nextInt(75);
System.out.println(playername+" you are starting on round 1 "+ " level "+ i + "question "+ i +" match the letter with the correct answer");
System.out.println(playername+" please add "+intvalue + " + "+ intvalue);
//implementing the letter for the correct answer
System.out.println("A:"+correct_ans);
System.out.println("B:"+incorrect_ans);
uSelect = reader.next().charAt(0);
if(uSelect == 'A' || uSelect == 'b')
{
System.out.println(playername+" excellent and brilliant kiddo!!! answer is correct, keep up the good work");
score += score + 350;
System.out.println("round 1");
System.out.println("level "+ i);
System.out.println("question "+ i);
totalscore += score;
System.out.println("total score is: "+ totalscore);
count++;
wrong = wrongcount + i;
}
else if(uSelect == 'B' || uSelect == 'b')
{
System.out.println(playername+" chittychitty bangbang!!!! answer is wrong, try again");
score -= score - 175;
System.out.println("round: 1");
System.out.println("level: "+ i);
System.out.println("question: "+ i);
totalscore -=score;
System.out.println("total score "+ totalscore);
count++;
wrong = wrongcount + i;
}
else if(uSelect == 2)
{
if(wrong > i)
{
System.out.println(playername+" you are still on round 1"+ "level "+ i +" question "+ i + " match the letter with the correct answer");
System.out.println(playername+" please add "+ intvalue + " + "+ intvalue);
//get the right letter to correct answer
System.out.println("A: "+correct_ans);
System.out.println("B: "+incorrect_ans);
uSelect = reader.next().charAt(0);
if(uSelect == 'A' || uSelect == 'b')
{
System.out.println(playername+" brillian kiddoo!!! yesss correct is right ");
score += score + 350;
System.out.println("round 1");
System.out.println("level "+ i);
System.out.println("question: "+ i);
totalscore += score;
System.out.println("total score "+totalscore);
count++;
}
else if(uSelect == 'B' || uSelect == 'b')
{
System.out.println(playername+" awwww come one now, kiddooo that is so wrong");
score -= score - 175;
System.out.println("round 1");
System.out.println("level:"+ i);
System.out.println("question "+ i);
totalscore -=score;
System.out.println("total score is: "+totalscore);
count++;
wrong = wrongcount + i;
}
}
}
}
}

