Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ please #2: ischaralpha.cpp In this program you'll ask the user to enter a single character in the main function. Then the character will
in c++ please
#2: ischaralpha.cpp In this program you'll ask the user to enter a single character in the main function. Then the character will be passed as an argument to the IsCharAlpha function. This function will test the input character value, and if it is an alphabetic character it will return a value of true; otherwise it will return a value of false. What data type is used to represent values of true and false? There's a special type in C++ called bool. A variable of type bool can only store one of two possible values: true or false. Thus, your function will return a value of true or false which are reserved words in C++ (see p.64 in your textbook for reference). Based on the return value of IsCharAlpha main will either display a message to the screen indicating that the character the user entered was an alphabetic character, or display a message indicating that the character is not an alphabetic character. (BTW, your testing of the character should strictly be your code, you shouldn't call any predefined library functions.) If you'd like to see a sketch of how a bool might be used, see SampleBool.cpp. Remember, before the compiler can compile a function call it must first see the function prototype, so make sure you've placed the function prototype above the main function. For more details on programmer-defined functions, read in your book beginning on p.189. Study the syntax of the program on p.190 so you're familiar with the terminologyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started