Need help ASAP on a math program

I am writing a math program that is just adding numbers. I am having a problem when it comes to if the put the wrong answer that it goes back to the question. I also need to figure out how to loop it back to generate new numbers after they answer the problem correctly. here is my code

Perhaps it will be useful to create a method which asks the question, and gets the a single answer, then a method which has a loop which repeats this question until a correct answer is given. Finally in main you would just have one loop, which asks generates the numbers, then begins the loop. Working with the smaller pieces and making them interact should make this easier to maintain and think about.

When comparing booleans in some statement which takes a boolean expression(if,while,etc) it is unnecessary to do

Java Code:

booleanVar == true

or the same for testing for false. The == returns a boolean, so it is no different then simply passing in the booleanVar instead you should test for truth with

Java Code:

if(booleanVar)

and falsehood with

Java Code:

if(!booleanVar)

Your while(true) loop will never end, it tells you to guess again, but doesn't actually get new input.

If using oop thinking is a bit above your level, you can just use static methods to break it up as well. While this can be accomplished in just the main method, it's harder to think about. When clumping everything into main, you need to be conscious of what everything is doing and how it works together. When using multiple methods(static of non), you allow yourself to think of individual pieces separately, which leads to an easier time designing the code. Another thing that I find useful is to write out what you want the code to do in English and as much detail as possible.

For example:(in regards to your code)

This code does the following, first it generates two random numbers and sums them up to form the answer. The answer is the number the player will be attempting to guess. After the answer is calculates the code will ask the user for some input. With this input the code will determine.....

I'll let you finish the rest. The more detail you can pour into this description, the easier it will be to translate to the actual code. The goal of this description is to outline what the method does in as much detail as possible. This program is fairly trivial, however; the description process I explained above can be valuable as you move to more complex programs. Stepping outside of the system(the programming language), and thinking about the program in easier to understand terms is a great approach. With other programs it could also be helpful to work out by hand how you would do something, then translating it to java(think fibb numbers, factorial, etc).

While it seems challenging, this problem is much simpler than it needs to be. I would recommend something like this for your final code