Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement in C++ Al udo-code for Exercise 2 1. This exercise is more complicated than it looks. You cannot just use a string variable and
Implement in C++
Al udo-code for Exercise 2 1. This exercise is more complicated than it looks. You cannot just use a string variable and use t such as comma or period .', that you don't want to be included in a string. So you will have to read in a character at a time and decide whether it is an alphabet or not. So it is convenient that you define the following function: o read a string at a time since there are punctuation marks, bool IsAlphabet(char ch); 2. Read in one character at a time, check if it is an alphabet, if so, concatenate it to the current word, using a string "operator, for example. When you finish building a word, you can then work on the replacement as in the next step. string word-" Read a word containing alphabets only while true) cin.get(next symbol); if (is alphabet next symbol)) word wordnextsymbol; else cin putback(next symool); break; 3. Define a replacement function by checking the input string to be one of the "sexist" words. If so, change the word to be the a-sexist version. Remember to handle if the word is capitalized or not. Al udo-code for Exercise 2 1. This exercise is more complicated than it looks. You cannot just use a string variable and use t such as comma or period .', that you don't want to be included in a string. So you will have to read in a character at a time and decide whether it is an alphabet or not. So it is convenient that you define the following function: o read a string at a time since there are punctuation marks, bool IsAlphabet(char ch); 2. Read in one character at a time, check if it is an alphabet, if so, concatenate it to the current word, using a string "operator, for example. When you finish building a word, you can then work on the replacement as in the next step. string word-" Read a word containing alphabets only while true) cin.get(next symbol); if (is alphabet next symbol)) word wordnextsymbol; else cin putback(next symool); break; 3. Define a replacement function by checking the input string to be one of the "sexist" words. If so, change the word to be the a-sexist version. Remember to handle if the word is capitalized or notStep 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