Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise, youll use methods of the String class to work with strings. Open the application C+ and add code to parse a name

In this exercise, youll use methods of the String class to work with strings. Open the application C+ and add code to parse a name

Open the application thats in the StringHandling directory. Within this project, youll find a form that accepts a name and a phone number from the user and provides buttons for parsing the name and editing the phone number.

Add code to parse the name when the user enters a name and clicks the Parse Name button. This code should work whether the user enters a first, middle, and last name or just a first and last name. It should also convert the parsed name so the first letters are uppercase but the other letters are lowercase. The results should be displayed in a message box like this:

image text in transcribed

Test the application to see if it works. Try entering the name in all uppercase letters or all lowercase letters to make sure the parsed name is still displayed with only the first letters capitalized. When youre done, close the form. Add code to edit a phone number

Add code to edit the phone number when the user enters a phone number and clicks the Edit Phone Number button. This code should remove all special characters from the user entry so the number consists of 10 digits. Then, format the phone number with hyphens. These results should be displayed in a message box like the one that follows. For simplicity, you can assume that the user enters ten digits.

image text in transcribed

Test the application with a variety of entry formats to make sure it works. When youre done, close the form and then close the solution.

String Handling Enter full name: Enter phone number: john doe kent| (514) 440-9071 Parse Name First name: bhn Middlensme: Doe Last name: Kent Exit OK Edit Phone Number Entered: (514) 440-9071 Digits only: 5144409071 Standard format: 5144409071 OK

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

1. Explain the difference between debt finance and equity finance.

Answered: 1 week ago