Question: Task05: Write an interactive Java program that prompts for and reads a string string1. If the length of string1 is greater than 20, the program

Task05: Write an interactive Java program that prompts for and reads a string string1. If the length of string1 is greater than 20, the program displays an error message and terminates; otherwise it prompts for read string2. If the length of string2 is greater than 20, the program displays an error message and terminates; otherwise it compares the two strings and displays one of the following messages accordingly: string1 and string2 are equal string1 is greater than string2 string2 is greater than string1Task05: Write an interactive Java program that prompts for and reads a

Enter a string! of length 20: The declaration: String stri does no Error The length of string1 > 20 Enter a string! of length 20: Eastern province Enter string2 of length

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!