Prompt the user for a string that contains two strings

Assignment Help JAVA Programming
Reference no: EM131585616

(1) Prompt the user for a string that contains two strings separated by a comma.
Examples of strings that can be accepted:Jill, Allen
Jill , Allen
Jill,Allen
Ex:
Enter input string: Jill, Allen

(2) Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings.

Ex:
Enter input string: Jill Allen
Error: No comma in string
Enter input string: Jill, Allen

(3) Extract the two words from the input string and remove any spaces. Store the strings in two separate variables and output the strings.

Ex:
Enter input string: Jill, Allen
First word: Jill
Second word: Allen

(4) Using a loop, extend the program to handle multiple lines of input. Continue until the user enters q to quit.

Ex:
Enter input string: Jill, Allen
First word: Jill
Second word: Allen


Enter input string: Golden , Monkey
First word: Golden
Second word: Monkey


Enter input string: Washington,DC
First word: Washington
Second word: DC

Enter input string: q

Reference no: EM131585616

Questions Cloud

Find a minimum-weight spanning tree of the graph : Find a minimum-weight spanning tree of the graph given in Example. First use any method you like, then do it using Kruskal's algorithm.
Find a minimum weight matching : Now suppose that the information given in the previous problem is listed in preference order, i.e., the book the student desires most is listed first.
Conduct a search online for tutorials about normalization : Conduct some research online for tutorials on Relational Database design. Conduct a search online for tutorials about normalization.
Financial and strategic parameters : Analyze the Comcast's company's performance, both on financial and strategic parameters.
Prompt the user for a string that contains two strings : Prompt the user for a string that contains two strings separated by a comma - Store the strings in two separate variables and output the strings
How time stamps will play a role in backtracking in time : Describe how time stamps will play a role in backtracking in time until the point of entry for the worm is located watching the worm travel across the network.
Describe what behaviors seem related to retention : Describe what behaviors seem related to retention of undergraduates on campus.compare those two variables for the two groups.
Case related to the crossword puzzle : Consider the mini-sudoku puzzle of Figure 10.24, in which each row, column, and quadrant needs to contain the numbers 1, 2, 3, 4.
Explain what service would you recommend and why : Would this cloud structure work regardless of how many students enroll? Based on your table, what service would you recommend and why?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Sentence patterns and verb formulas

Provide the sentence pattern. Write out the sentence pattern - then write out the tense of the verb and provide the formula.

  Write a java applet for grade of gas in costco gas station

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Identifing the appropriate class names, attributes & methods

I am having problems identifing the appropriate class names, attributes and methods for the following objects. I need at least 3 attributes and 3 methods for each class.

  1write a program that uses joptionpanes to perform the

1.write a program that uses joptionpanes to perform the following stepsmiddotfirst display a welcome message to your

  Calculate the premium and multiply the value of the object

Implement all the four Java classes described with the correct inheritance of abstract classes. Calculate the premium and multiply the value of the object being insured by the corresponding RATE. See the RATE tables above.

  Creating the gui for the game interface

A GUI-based application that allows a user to play a simple trivia game

  Build the gui layout of the game

Build the Build the GUI layout of the game in java.

  List various bindings that are needed to determine semantics

List the various bindings that are required to determine the semantics when the statement is executed. For each binding, indicate the binding time used for the language.

  Des algorithm for encrypting passwords

Several UNIX systems use the DES algorithm for encrypting passwords. These sys- tems typically apply DES 25 times in a row to obtain the encrypted password.

  Write a program in Java to check if a number is even

Write a program in Java to check if a number is even or odd in Java?

  Design a course registration system

Create an application which represents a simplified course registration system using ArrayLists and HashMaps.

  Principles of object-oriented programming

Develop, test, and execute a graphic application for simulations using Java - Create a Java application.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd