Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3) [8 points] You've been hired by Letter Lovers to write a C++ console application that analyzes the types of characters in a string entered

3) [8 points] You've been hired by Letter Lovers to write a C++ console application that analyzes the types of characters in a string entered by the user. Prompt for and get from the user a string containing at least ten characters. Use getline() to read the string. If the string contains fewer than ten characters, print an error message (and nothing else except the application close). If the string contains at least ten characters, test the third, sixth, and ninth characters to answer the following:

Is the character a digit?

Is the character alphanumeric?

Is the character punctuation?

Use formatted output manipulators (setw, left/right) to print the rows and columns shown below. Define constants for the column widths. Run the program five times with different strings. Get a screenshot of each run. The output should look like this:

Welcome to Letter Lovers

------------------------

Enter a string with at least ten characters: Hello World!

Output key: zero-false; non-zero-true

String: Hello World!

Length: 12

Third character: l

-Digit? 0

-Alpha? 2

-Punct? 0

Sixth character:

-Digit? 0

-Alpha? 0

-Punct? 0

Ninth character: r

-Digit? 0

-Alpha? 2

-Punct? 0

End of Letter Lovers

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_2

Step: 3

blur-text-image_3

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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

What are the classifications of Bank?

Answered: 1 week ago