my name is Dase Udumebraye, am new to the java programming language. A first year student at the university, i have an assignment to work on but i don't know how to go about it. below is the task description.
How do i go about developing a simple arithmetic tester program which can be used to help young children improve their arithmetic skill. The program should accepts string data for the player’s name and the number of questions they want to try, which will be entered by the user.
The program should take in the following inputs from the user:
The name of the player, so that the game can refer to them by name in messages. The name must be between 2 and 20 characters inclusive.
The number of sums that the user wants to attempt. This number must be a whole number, and be between 2 and 50 inclusive.
The program must check that the values entered fall within the valid ranges. The program must also check that no empty strings are entered for names.
Once the player has entered their name and the number of questions they want to attempt, the game begins. The program must generate sums for the player.
The program should generate one question at a time and display the question for the user. The questions must involve two numbers and be either a multiplication, division, subtraction, or addition. For example, the following are all valid questions:
3 * 4 = ?
8 / 2 = ?
7 + 1 = ?
9 – 8 = ?
The first number, second number, and arithmetic operator (multiply, divide, add, subtract) should all be chosen randomly, the program should Generate a new random number for each of the three parts of each sum. this requires you to choose one of the four symbols based on which random number is returned.
A few checks must be carried out before a generated question is displayed to the user. If the question is an addition question, no checks are required. If the question is a multiplication question, no checks are required. However, checks are required for subtraction and division sums.
If the question is a subtraction question, the program must check that the second number is equal to or smaller than the first number. Whilst the second number is larger than the first number, new numbers should be generated.