Write an application that acce

Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list.

For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered.

 

import java.util.*;
public class CategorizeStrings
{
publicstaticvoidmain (String[] args)
{

Write an application that acce

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] + ” “);
            

    }
}

Write an application that acce

Write an application that accepts a word from a user and converts it to Pig Latin. If a word starts with a consonant, the Pig Latin version removes all consonants from the beginning of the word and places them at the end, followed by ay.

For example, cricket becomes icketcray. If a word starts with a vowel, the Pig Latin version is the original word with ay added to the end. For example, apple becomes appleay. If y is the first letter in a word, it is treated as a consonant; otherwise, it is treated as a vowel. For example, young becomes oungyay, but system becomes ystemsay. For this program, assume that the user will enter only a single word consisting of all lowercase letters.

Write Java code

 

import java.util.*;
public class PigLatin {
    public static void main(String[] args) {
        // Write your code here
    }
    public static boolean isVowel(char c) {
        // Write your code here
    }
}

 

Write an application that acce

Here is the question:

Write an application that accepts three Strings from the user and displays them in alphabetical order without regard to case.

Here is the code so far just needs to be altered:

import java.util.*;
public class Alphabetize2
{
   public static void main(String[] args)
   {
      String str1, str2, str3;
      Scanner in = new Scanner(System.in);
      System.out.print(“Enter first string >> “);
      str1 = in.nextLine();
      System.out.print(“Enter second string >> “);
      str2 = in.nextLine();
      System.out.print(“Enter third string >> “);
      str3 = in.nextLine();
      
      // display strings in alphabetical order
      if(str1.toLowerCase().compareTo(str2.toLowerCase()) < 0 &&
       str2.toLowerCase().compareTo(str3.toLowerCase()) < 0)
        System.out.println(“You entered the strings in alphabetical order”);
     else
        System.out.println(“You did not enter the words in alphabetical order”);
  }
}

Write an application that acce

This is the question I am stuck on –

Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list.

For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered.

This is the code I have but I am not getting any checks correct with it –

import java.util.Scanner;

public class CategorizeStrings {

public static void main(String[] args) {

int SIZE = 20;

String[] sStrings = new String[SIZE];

String[] lStrings = new String[SIZE];

String s;

int sCounter = 0, lCounter = 0;

Scanner sc = new Scanner(System.in);

for (int i = 0; i < SIZE; i++) {

System.out.print(“Enter a string : “);

s = sc.nextLine();

if (s.equalsIgnoreCase(“zzz”)) { // checking for sentinal value

break;

} else {

if (s.length() <= 10) // if short string

sStrings[sCounter++] = s;

else // if long string

lStrings[lCounter++] = s;

}

} // end of for

System.out.println(“\n\n1.Display Short strings\n2.Display Long Strings\nEnter choice : “);

int choice = sc.nextInt();

if (choice == 1) {

if (sCounter == 0) {

System.out.println(“The list is empty”);

} else {

for (int i = 0; i < sCounter; i++) {

System.out.println(sStrings[i]);

}

}

} else if (choice == 2) {

if (lCounter == 0) {

System.out.println(“The list is empty”);

} else {

for (int i = 0; i < lCounter; i++) {

System.out.println(lStrings[i]);

}

}

} else {

System.out.println(“Invalid Choice”);

}

}

}
 
Here is an example of one of the checks I a,m gettign wrong –

Test Case Incomplete

Categorize Strings A B C D, 3 idioms

Input
A
B
C
D
A penny for your thoughts
Barking up the wrong tree
Curiosity killed the cat
ZZZ
S
ZZZ

Output
Enter a string : A
Enter a string : B
Enter a string : C
Enter a string : D
Enter a string : A penny for your thoughts
Enter a string : Barking up the wrong tree
Enter a string : Curiosity killed the cat
Enter a string : ZZZ
1.Display Short strings
2.Display Long Strings
Enter choice :
S
Exception in thread “main” java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:864) at java.util.Scanner.next(Scanner.java:1485) at java.util.Scanner.nextInt(Scanner.java:2117) at java.util.Scanner.nextInt(Scanner.java:2076) at CategorizeStrings.main(CategorizeStrings.java:45)
ZZZ
 
Results(all are marked in red for being wrong/incorrect)
A
B
C
D

Write an application that acce

Write an application that accepts a word from a user and converts it to Pig Latin. If a word starts with a consonant, the Pig Latin version removes all consonants from the beginning of the word and places them at the end, followed by ay.

For example, cricket becomes icketcray. If a word starts with a vowel, the Pig Latin version is the original word with ay added to the end. For example, apple becomes appleay. If y is the first letter in a word, it is treated as a consonant; otherwise, it is treated as a vowel. For example, young becomes oungyay, but system becomes ystemsay. For this program, assume that the user will enter only a single word consisting of all lowercase letters.

Write an application that acce

Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list.

For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered.

 

import java.util.*;
public class CategorizeStrings
{
publicstaticvoidmain (String[] args)
{
// your code here
}

// display()
}

Write an application that acce

Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list.

For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered.

 

code given

import java.util.*;
public class CategorizeStrings
{
publicstaticvoidmain (String[] args)
{
// your code here
}

// display()
}

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more