Question: Write a Java GUI program that contains the following class, i.e, class SecretCode. Please refer to the given UML diagram for the minimum required class's

Write a Java GUI program that contains the following class, i.e, class SecretCode. Please refer to the given UML diagram for the minimum required class's data fields and methods. You are free to add additional class members as you see fit. ecretcode -inputstring: string stringLength: int -outputstring: Strin +Secretcode +SecretCode(inputstring: String) +getstringLength(inputString: String): int +checkstringvalidity(inputstring: String) boolean +shiftchar(inputString: String, stringLengthnt): Stri The GUI program allows the user to input a String literal, and the program shall display an encoded String literal as an output. The method shiftchar) handles the encoding process by executing the following ep Accept a string literal, i.e, inputstring. Perform a check (using method checkstringvalidity)) to ensure the String tep literal ONLY contain toz' or whitespace, if this condition is not met, prompt user for a new input. Step 3 Compute the number of characters inside inputstring, excluding whitespace(s). sieMor each character in i nput string, shift it forward n position(s), with n equals to the number of characters (excluding whitespace(s)) inside inputstring. The characters are arranged inside a cyclic structure, see Figure 2. Figure 2 For example, a String literal "zoo kch" has a length of 6 characters. Thus, the encoded output is: The encoded String literal: "euufqin Step 5 The method returns the encoded String literal for display
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
