Question: Worksheet.java An elementary teacher would like to be able to quickly create a worksheet filled with problems dealing with addition and subtraction. Given your expertise,
Worksheet.java An elementary teacher would like to be able to quickly create a worksheet filled with problems dealing with addition and subtraction. Given your expertise, you will take this challenge. Write a program that will create a worksheet of 20 problems that are randomly assign as addition or subtraction. To allow the user flexibility in the types of problems, allow the user to enter the range of numbers to be used. In other words, prompt the user to enter the starting value and ending value. Create three 1 dimensional arrays in order to hold the first number, the second number and the answer for each problem. Randomly fill the first two arrays with numbers using between the starting and ending values the user typed in, then store the answers in the third array. Create a file named, Worksheet.txt. You will write the following worksheet to that file. Make the worksheet using the following example as a template. The first number comes from the first array, and likewise for the second number. The symbol '+'or-is randomly determined for each problem. The worksheet will state that it is dealing with addition and subtraction problem from the given starting value to the given ending value as well as a place for the name and date. After the problem set has been created, give five blank lines and the answer key, which will allow the teacher to separate the Key from the worksheet. As always use good programming conventions as taught in class, including multiple methods and encapsulated (private) field variables, if you choose to use them. Example: Addition and subtraction practice using numbers-10 to 10 Name Date_ 1. 8.5 = 2. 0-3 = 3.-4+-8 = 4. 3 + 7 = until you have 20 problems. Note, the last equal sign, should be at or before the line for Name and Date, not after it. (5 blank lines) Answer Key 1. 13 2.-3 3. -12 4. 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
