Write an application that accepts any number of String values from a user until they enter zzz or have entered 15 strings, and display them in ascending order.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 12RQ
icon
Related questions
Question

This is the question I am stuck on -

Write an application that accepts any number of String values from a user until they enter zzz or have entered 15 strings, and display them in ascending order.

This is the code I have started to try but I am honestly just confusing myself more - 
import java.util.*;
public class StringSort2 {
    public static void main(String[] args) {
        // Write your code here
        Scanner input = new Scanner(System.in);
        String values;
        int x;
        System.out.println("Please enter your values: ");
        values = input.nextLine();
            for(x=15; x < values.length; ++x)
            System.out.println(values[x] + " ");
            

    }
}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,