Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 12 Sep 2017 My Price 9.00

EOF is encountered

Write a C++ program that repeatedly reads lines until an EOF is encountered. As each line is read, the program strips out all characters that are not upper or lower case letters or spaces, and then outputs the line. Thus, the program acts as a filter and issues no prompt. There are many ways this program could be written, but to receive full credit, you must observe the following:

Place your code in a file called filterChars.cpp.

The program should consist of four functions whose prototypes are:
- int main(); o void removeNonAlpha(string& str);
- bool isUpperCaseLetter(char ch);
- bool isLowerCaseLetter(char ch);

The main() function should

1. read string input - an entire line, including spaces (try getline())
2. call removeNonAlpha() to process the input string
3. print out the string as altered by removeNonAlpha()
4. not call isUpperCaseLetter() or isLowerCaseLetter() directly

The function removeNonAlpha() alters its string reference variable by removing all characters that aren't upper or lower case letters or spaces. Use the function erase() in the string class to remove the characters. Use the functions isUpperCaseLetter() and isLowerCaseLetter() to help identify which characters to remove.

The functions isUpperCaseLetter() and isLowerCaseLetter() simply return true if the character parameter is an upper-case or lower-case letter, respectively, and false otherwise. These two functions can easily be one-liners. Note: DonA????1t use any library functions (specifically, use neither islower nor isupper) in isUpperCaseLetter() and isLowerCaseLetter(). Use an if statement instead.

Use
   while(getline(cin, inString)).
for the input.

Answers

(5)
Status NEW Posted 12 Sep 2017 10:09 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)