Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Core Lab 2.11 [4 lab points] Using the string for this Co methods in the class LabCh025tringMethods, here are the specifications ore Lab. You will

image text in transcribed
Core Lab 2.11 [4 lab points] Using the string for this Co methods in the class LabCh025tringMethods, here are the specifications ore Lab. You will also need to declare some integer and String variables to hold various pieces of information. Think carefully what you do in what order to prevent redoing certain statements. 1. From the keyboard, prompt for and type in a name in last name, first name order, with a comma after the last name and a space after the comma. Example: Doe, Jane. Your program can assume a user will always type a name with all the correct information included. Well learn later how to catch exceptions to that rule. (To see what happens when there are errors, enter a name without a comma, and enter the empty string by pressing enter at the prompt.) 2. Print the name in first name and last name order. Example: Jane Doe You have to figure out what methods to use. 3. Print how long (how many characters) the first and last names are with a message identi- fying each part of the name and length. Example: with "Jane Doe" as the name, this step will produce the output: Jane: 4 characters, Doe: 3 characters 4. From the keyboard, type in a phone number in this format: (303) 123-4567. Extract the area code and print it. Your program can assume a user will always type a phone number

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions