Write An Essay logo
  • Home
  • Dissertation Writing
  • Essay Writing
  • Personal Statement
  • My account
  • Order now
Order Now
Homework Help

Parsing strings (java) | IT145 | Southern New Hampshire University

1 min read
Posted on 
March 18th, 2022
Home Homework Help Parsing strings (java) | IT145 | Southern New Hampshire University

 

(1) Prompt the user for a string that contains two strings separated by a comma. (1 pt)

  • 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. (2 pts)

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. (2 pts)

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. (2 pts)

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

Order an Essay Now & Get These Features For Free:

Turnitin Report

Formatting

Title Page

Citation

Outline

Place an Order
Share
Tweet
Share
Tweet
Calculate the price
Pages (275 words)
$0.00
Write An Essay
Company
  • Why Choose Us
  • About Us
  • Terms
  • Dissertation Help
  • Personal Statement
  • Research Paper Format
  • Term Papers
Legal
  • Write My Essay
  • Thesis Format
  • Custom Papers
  • Coursework Writing
  • Dissertation Writing
  • Essay Writing
How Our Service is Used:
Write An Essay essays are NOT intended to be forwarded as finalized work as it is only strictly meant to be used for research and study purposes. Write An Essay does not endorse or condone any type of plagiarism.
Subscribe
No Spam
© 2023 Write An Essay. All rights reserved.
Write An Essay will be listed as ‘Write An Essay’ on your bank statement.