Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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 not

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago