Question
JAVA .. ECLIPSE .. RANDOM NUMBER GENETATOR NEED TWO CLASSES ONE FOR ALL THE METHOD AND OTHER FOR EXECUTION> addition -two operands, both in the
JAVA .. ECLIPSE .. RANDOM NUMBER GENETATOR NEED TWO CLASSES ONE FOR ALL THE METHOD AND OTHER FOR EXECUTION>
addition -two operands, both in the range 0 -12subtraction -two operands, the first in the range 6-12 and the second less than or equal to the first for example (12-10, 6-2, etc.)Rule: if the first operand is 7, for example, the second operand must range from 0 to 7.Your task is to write a programmer defined class that contains a randomly generated addition or subtraction problem A toStringmethod that returns a String containing the question (but not the answer). The format should be operand1, a space, operator, a space, operand2, a space and an equal sign. A determineAnswermethod that calculates the answer to the question and returns the answer (an integer). The answer should notbe stored as an instance variable.
Once you have the instance variables, accessormethods, constructor, toString, and determineAnswermethods written, test your code in the application class to make sure it works properly.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started