Final answer:
The student query is about creating a ComparisonTester class in Java to compare doubles, integers, and strings using a Comparison object; it includes steps like input handling, object creation, calling methods, and outputting results.
Step-by-step explanation:
The student is asking for guidance on how to create a tester class that compares different types of input using a Comparison object. .
To complete this task, one must:
- Create a ComparisonTester class with the necessary setup or 'plumbing'.
- Import the Scanner class and create a Scanner object for input.
- Prompt the user to enter two doubles and two integers, storing the input in the appropriate variables.
- Clear the input buffer with nextLine() to avoid input issues when switching from numbers to strings.
- Prompt the user to enter two strings.
- Create a Comparison object and a Boolean variable areTheyEqual.
- Use the Comparison object to call comparison methods such as compFloat2, compFloat5, complnt, stringEqual, stringEqualNoCase, and stringCompare, and assign the results to areTheyEqual.
- Output the results of the comparisons to the user.