Question: how to follow this chart to using compare ignore-case ? it compares two strings,I listed the problems that will be included to the flow chart.

how to follow this chart to using compare ignore-case ? it compares two strings,I listed the problems that will be included to the flow chart. I am using java eclipse

 how to follow this chart to using compare ignore-case ? it

compares two strings,I listed the problems that will be included to the

flow chart. I am using java eclipse 7- Declare and instantiate a

Scanner variable splitter as before, but in the constructor, write the variable

names as a parameter, that is use the following code: Scanner splitter

7- Declare and instantiate a Scanner variable splitter as before, but in the constructor, write the variable names as a parameter, that is use the following code:

Scanner splitter = new Scanner(names);

8- Apply the method call splitter.next( ) three times and save the return values one after each other in the variables name1,name2 and name3 respectively

9- Create an if else logic to determine the lexicographic order of the names. For this purpose, use the compareTo method of the String class with the ignore case option; declare and use additional helper variables if needed. There are six possible orders for three names, your selection logic must cover all of them.

10-Collect and save the names in correct order in a single String variable namesOrdered

11-Display the variable namesOrdered on a message dialog as shown on Figure 3 and also in the console.= new Scanner(names); 8- Apply the method call splitter.next( ) three times

12- Test your program for each of the 6 possible arrangements of three input words (you may use short words for testing purposes like A B C. Note that the 6 possible arrangement of three input words can be achieved only that the three input words must be distinct.

13- Use a while-loop statement for continuing string comparison. For example,

while (yesNo == JOptionPane.YES_OPTION)

{

. . .

//Continue string comparison (See Figure 4)

task = "Do you want to continue string comparison?";

yesNo = JOptionPane.showConfirmDialog(null, task,title,

JOptionPane.YES_NO_OPTION);

} //end while-loop

and save the return values one after each other in the variables

In Figure 4, if click on Yes, it will go to Figure 2c, allowing for another round of string comparison, by entering the input dialog box for another names as shown in Figure 5.

name1,name2 and name3 respectively 9- Create an if else logic to determine

the lexicographic order of the names. For this purpose, use the compareTo

From Figure 4, if click on No, it will go to Figure 1a, for ending this program. Therefore, for each run of this program, many set of names can be sorted in lexicographic order without restaring the program.

method of the String class with the ignore case option; declare and

(1) (2) (3) NI = N2 = N3 N1 = N2 N3 NI = N2 > N3 N1 = N2 N1 = N2 NI N2 N3 ? (5) N1 = N2 N2=N3 N2 + N3 (6) N2 = N3 N2 > N3 = N1 N2 N3 = N1 N2 > N3 N2 N3 N2 N3 (8) (9) NI N3 (3) N1 N2 A (5) NI N2 = N3 N2 = N3 N2 + N3 (6) N2 = N3 N2 N3 = N1 N2 N3 = N1 N1 N2 N1 CN2 (9) NI N3 N1 N2 N2 + N3 NI N2 = N3 (5) N2 = N3 N1 N3 N1 = N3 N2 > N3 = N1 N2 N3 = N1 N2 > N3 N2 (11) N3N2 N3 N1 N2 N2 + N3 NI # N3 (3) (4) (5) NI N2 = N3 N2 N3 N2 > N3 N2 N3 (6) (7) N2 > N3 = N1 N2 N3 = N1 NI N2 Nl N3 Nl N3 NI N3 (1) (2) (3) N1 = N2 = N3 N1 = N2 N3 (4) (5) NI N2 = N3 NI N3 1 Nl N3 = N1 N2 N3 = N1 NI N2 N1 N2 min = N1 N2 > N3 (8) (9) NI

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!