Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(30 Points) Write a complete, working C++ program called euidA.cpp (where euid is your EUID) that does the following: . Declare an enumeration constant that

image text in transcribed
(30 Points) Write a complete, working C++ program called euidA.cpp (where "euid" is your EUID) that does the following: . Declare an enumeration constant that can take three possible values-Digits, Lower and 1. Upper. Assign characters 'D', 'L' and 'U' respectively to the data items. This will be used to provide a choice to user to whether count the number of digits, lowercase uppercase characters in the user supplied string. Declare an integer variable to store the count of the character type chosen by the user and initialize them to 0 Declare a character variable. This character variable will represent one of the three types of characters. Declare a string variable to store the sentence entered by the user. The string must have more than one word. Using cin and cout statements, prompt the user to enter a sentence with a suitable message. or . . Using cin and cout statements, prompt the user to enter an appropriate character to select the desired character type with a suitable message. You may assume that the user will input the character in uppercase letters. Design a switch-case block with a default case using your character variable as the switching expression. Your statements must have the enumeration constants- Digits, Lower and Upper- as the case constants. For either of the cases, using a loop of your choice, check whether a character is of the appropriate type i.e. a digit, a lowercase, or an uppercase character. Check one character at a time. If it is, increment the counter. The default case must inform the user of wrong choice. o o o . Display the count of the character type as selected by the user with a suitable message. . Due to time constraints, no comments are required in this code. SAMPLE OUTPUT $ .la.out Enter the sentence: This is CSCE1030! Enter 'D' to count digits, 'L' to count lowercase, 'U' to count uppercase:L The total number of desired characters is:5 $./a.out Enter the sentence: This is CSCE1030

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

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

=+What kind of love? Virtue Appeal

Answered: 1 week ago