Qasim A.

asked • 01/24/22

I need help with java code cant get output

I need the following output:


Values: Allen Amy Bill Chris Jane John Sue


So far I have:


import java.util.*;

public class StringSort2

{ public static void main(String[] args)

{ Scanner input = new Scanner(System.in);

String[] values = new String[15];

int x = 0; int count = 0;

String word; final String QUIT = "zzz";

boolean didUserQuit = false;

for(x = 0; x < values.length; ++x)

values[x] = QUIT;

x = 0; while(x < values.length)


if(!didUserQuit) count = values.length;

String message = "Values:"; Arrays.sort(values);

for(x = 0; x < count; ++x)

message = message + " " + values[x];

System.out.println(message); } }



1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.