Write a program using C++: **String Maniplulation**?


Question:
Write a program that can be used to train the user to use less sexist language by suggesting alternative versions of sentences given by the user. The program will ask for a sentence, read the sentence into a string variable, and replace all occurences of masculine pronouns with gender-neutral pronouns. For example, it will replace "he" with "she or he". Thus, the innput sentence:

See an advisor, talk to him, and isten to him.

should produce the following suggested changed version of the sentence:

See an advisor, talk to her or him, and listen to her or him.

************
HINT
************
Write a pattern matching function:
-> That returns to start index, of the fisrt instance of pattern in target.
-> Then the text to be edited for sexist language to be traversed for each instance of sexist language, searching and replacing instances as found.

Answer:
Do your homework for you? Why don't you post what YOU think it should be, and we'll tell you if you are right or not.
too much work for too little reward.
What left-wing feminist zealot gave this assignment? You should investigate the string.h package, specifically the strstr (substring) and strcpy (string copy) functions. String manipulation is much easier in Java, by the way.
You need to replace specific words with other words.

I think you should tokenize the string into words and store them in an array of strings.

Then search the array for sexist words and replace the word with a suitable correction.

It seems easier to me that way. then output the array as the sentence.

All of what I said can be done using standard C++ <string.h> library
More Questions & Answers...
  • Site advisor program?
  • Why do Liberals Spread Poverty?
  • A question for any Health/Sex Education teachers out there...?
  • Hey ppl i need some help plz!?
  • The system advisor on my computer says I need to have an anti-spam program on my computer. What do you suggest
  • Does anybody know what happens if you quit the Merrill Lynch/Morgan Stanley Financial Advisor program without?
  • What grants are there for financil aid aside from the WIA and Federal Pell Grant?
  • Masters in counseling?
  • The questions and answers post by the user, for information only, AnswersRoom.com does not guarantee the right
    Copyright © 2007 AnswersRoom.com -   Terms of Use -   Contact us

    Hot Topic