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"

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;

public class ParseStrings {

  public static void main(String[] args) {

     Scanner scnr = new Scanner(;

     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]);


           inputDone = true;


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

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

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


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

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

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


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

        inputDone = true;




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