Question: I need help with this exercise. Than you for the help. Language is C++ 2 Enumeration Data Types Reformat is the shell of a program

I need help with this exercise. Than you for the help. Language is C++

I need help with this exercise. Than you for the help. Language

is C++ 2 Enumeration Data Types Reformat is the shell of a

2 Enumeration Data Types Reformat is the shell of a program designed to read characters and process them in the following way Lowercase character Uppercase character Digit Blank Newline Any other character Converts to uppercase and writes the character Writes the character Writes the digit Writes a blank Writes newline Does nothing / Program Reformat reads characters from file DataIn and // writes them to DataOut with the following changes: // all letters are converted to uppercase, digits are unchanged, and all other characters except blanks and // newline markers are removed #include #include #include using namespace std; enum CharType (LO CASE, UP CASE, DIGIT, BLANK NEWLINE, OTHER) CharType KindofChar (char) 7Post: character has been converted to the corresponding // constant in the enumeration type CharType int main ifstream dataIn; ofstream dataOut; char character; dataIn.open ("reformat.dat") dataout.open ("dataout.dat") dataIn.get (character): 11 Priming read while (dataIn) switch (KindofChar (character)) 7FILL IN the code to output the correct character to dataout dataIn.get (character) return 0 CharType Kindofchar (char character) if (isupper (character)) return II TO BE FILLED IN else if (islower (character)) return TO BE FILLED IN else if (isdigit (character)) return // TO BE FLLED N else if (character #- " Il character -- " ") return I/ TO BE FILLED IN else return // TO BE FILLED IN Exercise 1: You are to fill in the code of function KindOfChar and the switch statement in the body of function main. Run your program. List below the last three lines of output written on file DataOut. (Note: the functions isupper, islower, isdigit are provided by the cctype library. isupper returns true if the parameter character is an upper case letter. islower returns true if the parameter character is a lower case letter. isdigit returns true if the parameter character is a decimal digit. You can use the toupper function also provided by the cctype library to convert a lower case letter to upper case.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!