Question: Create a new Project (Lab6). 1) Task: Practice with string comparisons (8 pts) a) Create a new package task1 and a new class in that

Create a new Project (Lab6). 1) Task: Practice with string comparisons (8 pts) a) Create a new package "task1" and a new class in that package "StringCompare". Add the empty "main" method in your class. b) Problem: o main: - - In the "main" method, create a Scanner object to read user keyboard input. Prompt the user to enter a string value. Read the string value (this can be multiple words so read everything they entered) - Prompt the user to enter a 2nd string value. *Read the string value (this can be multiple words so read everything they entered) Call your "equalityCheck" method passing the 2 strings as parameters (we will write that method shortly). That method should have a void return type so nothing will be returned. Call your "comparisonCheck" method passing the 2 strings as parameters (we will write that method shortly). That method should have a void return type so nothing will be returned Done! o equalityCheck (accepts 2 parameters-the 2 sting values read in) This is a simple method - if the string values are equal, print "The 2 Strings are equal" otherwise print "The 2 Strings are NOT equal". Be sure the results are accurate. - o comparisonCheck (accepts 2 parameters-the 2 sting values read in) -If the 1st string parameter is less than the 2nd string parameter, print "first-string' is LESS THAN 'second-string". (use the actual string values in your print statement, do not literally print first-string', or 'second-string) -If the 1st string parameter is greater than the 2nd string parameter, print "first-string' is GREATER THAN 'second-string"". (use the actual string values in your print statement, do not literally print first-string', or 'second-string') Otherwise, print "first-string' is EQUAL TO 'second-string. (use the actual string values in your print statement, do not literally print first-string', or second-string')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
