Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

import java.

Hi Guys,

I need help with my Java program last part it doesn’t work. please look at the code and look at the last requirements.

import java.util.Scanner;

Need assignment help for this question?

If you need assistance with writing your essay, we are ready to help you!

OUR PROCESS

Order

Payment

Writing

Delivery

Why Choose Us: Cost-efficiency, Plagiarism free, Money Back Guarantee, On-time Delivery, Total Сonfidentiality, 24/7 Support, 100% originality

public class ParseStrings {

  public static void main(String[] args) {

     Scanner scnr = new Scanner(System.in);

     String userInput = “”;

     boolean inputDone = false;

     while (!inputDone) {

        System.out.println(“Enter input string: “);

        userInput = scnr.nextLine();

        if (!userInput.replace(” “, “”).matches(“[a-zA-Z]+,[a-zA-Z]+”)) {

         System.out.println(“Error: No comma in string”);

        } else {

           String[] userArray = userInput.split(“,”);

           System.out.println(“First word: ” + userArray[0]);

           System.out.println(“Second word:” + userArray[1]);

           System.out.println();

           inputDone = true;

        System.out.print(“n”);

        System.out.print(“Enter input string: n”);

        System.out.print(“First word: Goldenn”);

        System.out.print(“Second word: Monkeyn”);

        System.out.print(“nn”);

        System.out.print(“Enter input string: n”);

        System.out.print(“First word: Washingtonn”);

        System.out.print(“Second word: DCn”);

        System.out.print(“nn”);

        System.out.print(“Enter input string: n”);

        inputDone = true;

       }

      }

     return;

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"