Write a
See an adviser, talk to him, and listen to him.
should produce the following suggested changed version of the sentence:
See an adviser, talk to her or him, and listen to her or him.
Be sure to preserve uppercase letters for the first word of the sentence. The pronoun “his” can be replaced by “her (s)”; your program need not decide between “her” and “hers”. Allow the user to repeat this for more sentences until the user says she or he is done.
This will be a long program that requires a good deal of patience. Your program should not replace the string “he” when it occurs inside another word, such as “here” A word is any string consisting of the letters of the alphabet and delimited at each end by a blank, the end of the line, or any other character that is not a letter. Allow your sentences to be up to 100 characters long.
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Problem Solving with C++ (9th Edition)
Additional Engineering Textbook Solutions
Experiencing MIS
Database Concepts (7th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Using MIS (10th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
- Make Camel Case. Create a program that reads a multi-word phrase, and prints the Camel Case equivalent. For example, for input "total account balance" the program shall output "totalAccountBalance". Notice that the first word is in lowercase (even if it contains uppercase letters). The rest of the words, only their initials are capitalized.arrow_forwardMake Camel Case. Create a program that reads a multi-word phrase, and prints the Camel Case equivalent. For example, for input “total account balance” the program shall output “totalAccountBalance”.Notice that the first word is in lowercase (even if it contains uppercase letters). The rest of the words, only their initials are capitalized.arrow_forwardWrite a java program. Zeeshan wanted to increase his typing speed competative programming contests. His friend suggested him to type the sentence "the quick brown fox jumps over the lazy dog" repeatedly. This sentence is called pangram because it contains every letter of the alphabet. After typing the sentence several times, Zeeshan became bored with it so he started to look for the pangrams. Given a sentence s as a string, determine weather it is a pangram or not. Assume that thestring would be in lowercase. Write a method named isPangramSentence(String sentence) thet accepts a string asargument and return true if the sentence is true if the sentence is pangram otherwise returns false.arrow_forward
- 3. Write a program that transforms numbers 1, 2, 3,..., 12 into the corresponding month names January, February, March, ..., December. Hint: Make a very long string "January February March ...", in which you add spaces such that each month name has the same length. Then use substring to extract the month you want.arrow_forwardWrite a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters in any order. For example, “silent” and “listen” are anagrams. The header of the function is as follows: bool isAnagram(const string& s1, const string& s2) Write a test program that prompts the user to enter two strings and checks whether they are anagrams.arrow_forwardPrograming Carrow_forward
- Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characters with a period at the end. For example: "This is a possible value of sentence."arrow_forwardWrite a program with a function that accepts a string as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument is “hello. my name is Joe. what is your name?” the function should return the string “Hello. My name is Joe. What is your name?” The program should let the user enter a string and then pass it to the function. The modified string should be displayedarrow_forwardWrite a program which takes a string from the user and replaces all occurrences of ‘b’ with ‘$’.arrow_forward
- We want to create a program that reads a string and removes from it the characters between two marker characters. For example for the input text: (to buy) We need to buy (i) milk, (ii) eggs, (iii) flour, and (iv) sugar. And using "(" and ")" as the starting and ending markers, the program should output: We need to buy milk, eggs, flour, and sugar. Notice that the number of characters between the markers, and the number of markers present in the string may vary. We will assume that if a starting marker appears in the input text, its corresponding ending marker is also present in the string. Approach: The idea is to copy characters from the input text to an output string variable as long as we have not found the starting marker. From that point on, we ignore the characters in the input text until we find the ending marker. Once we find the ending marker, we resume copying characters to the output string variable, and the process repeats. Drag into the placeholders below the appropriate…arrow_forwardQ49. Write a program which replace all the words "man" with "woman". Sample Text: That is a strong man.arrow_forwardmake a program, that has a function that takes in a string argument and prints a sentence indicating the shortest word in that string. If there is more than one word print only the first. Your print statement should read: “The shortest word is x” Where x = the shortest word. The word should be all uppercase.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning