Develop a program to generate examples for the control work on arithmetic. The following options are entered on the settings screen:
Number of examples: [ 1]
Number of actions: [ 5]
Number range, minimum: [-1000]
The range of numbers, max [1000]
Valid arithmetic operations:
2+2? [X]
2-2? [X]
2*2? [X]
2:2? [X]
-(-2)? [X] // sign change
The name of the output file: [kontr1.txt]
Here [X] - checkboxes; [...] - input fields.
Output the generated examples together with the answers to the specified file, separating with an empty string, as follows:
4 : (1 + 1) =
Answer: 2
2 + 3 =
Answer: 5