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 string1
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
Get step-by-step solutions from verified subject matter experts
