Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

given this example, modify it so it is in an applet. The prompts will now be in

ID: 3539013 • Letter: G

Question

given this example, modify it so it is in an applet. The prompts will now be in labels and the input will now be textfields. The user will hit enter in the second textfield to get the results in two other answer labels. The results (which is greater and the difference amount) will be in these two other answer labels. Declare everything at the top, use the init to add the components to your container (use background and foreground colors and the flow layout), and use actionPerformed to get the text out of the textfields for the two strings (instead of readLines), to perform the nested if else with the comparisons, and the setting of the answers in the answer labels (instead of printlns). import java.io.*; public class example { public static void main(String[] args) throws IOException { String s1, s2; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter a string: "); s1 = br.readLine(); System.out.print("Enter a string: "); s2 = br.readLine(); if (s1.equals(s2)) // s1 == s2 System.out.println("Same string"); else if (s1.equalsIgnoreCase(s2)) System.out.println("Same string - different case"); else if (s1.compareTo(s2) > 0) // s1 > s2 System.out.println(s1 + " is alphabetically greater than " + s2); else // s1 < s2 System.out.println(s1 + " is alphabetically less than " + s2); System.out.println("Difference is " + s1.compareTo(s2)); } }

Explanation / Answer

Hi, do u have a user interface or I can build my own ?

I can do it but need time. Reply if ok, I will give u my email id to keep in touch