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++ (10th 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 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_forwardThe internet enables people to network, join a cause, take a poll, etc. Your program will prompt the user for a description of a poll to be taken and then prompt 5 users for a response of 1-10 (1 being a 'poor' response; 10 being the 'best' response).Your program does not have to validate that the user entered 1-10. We'll do that type of checking later.Your program must use a string data type to store the poll description and a Python list data type to save the integer responses of the 5 user responses.Your output should list all the responses stored in the list, the highest given response, the lowest given response and the average of the 5 responses. See sample input and utput below.Review powerpoint 3, slide 21 for an example if you need one. Sample interactive run of your program: Give a simple description of the poll to be takenRate your understanding of the first 3 zyBook chaptersEnter a 1-103Enter a 1-1010Enter a 1-104Enter a 1-102Enter a 1-105Sample outputRate your understanding…arrow_forwardQ15arrow_forward
- Define a struct menuItemType with two components: menuItem of type string and menuPrice of typedouble. Write a program to help a local restaurant automate its breakfast billing system. The programshould do the following:a. Show the customer the different breakfast items offered by the restaurant.b. Allow the customer to select more than one item from the menu.c. Calculate and print the bill. Assume that the restaurant offers the following breakfast items (the price of each item is shown to theright of the item): Plain Egg - $1.45Bacon and Egg - $2.45Muffin - $0.99French Toast - $1.99Fruit Basket - $2.49Cereal - $0.69Coffee - $0.50Tea - $0.75 Use an array menuList of type menuItemType, as definedYour program must contain at least the followingfunctions:- Function getData: This function loads the data into the array menuList.- Function showMenu: This function shows the different items offered by the restaurant and tellsthe user how to select the items.- Function printCheck: This function…arrow_forwardCreate a function that tallies the number of times a phrase appears in a string. The function's output should be a number. Don't presume that a single space divides words, and that a string can contain punctuation. Create the method so that it can accept a String input or a StringBuilder object.arrow_forwardWrite a program that inputs a student's name in the following form: lastName, firstName middleName. The program will convert the name to the following form: firstName middleName lastName. Your program must read the student's entire name in one variable and must consist of a user-defined function that takes as input a string, consisting of a student's name, and returns the string consisting of the altered name. You can use the string function find to find the index of ,(the comma); the function length to find the length of the string; and the function substr to extract the firstName, middleName, and lastName.arrow_forward
- Make a C programarrow_forwardWrite a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and 100), and grade of type char. Suppose that the class has 20 students. Use an array of 20 components of type studentType. Your program must contain at least the following functions: a: A function to read the students’ data into the array. b: A function to assign the relevant grade to each student. c: A function to find the highest test score. d: A function to print the names of the students having the highest test score. Your program must output each student’s name in this form: last name followed by a comma,…arrow_forwardC++ we have a function called send email and send email is going to send an email. It's not going to return anything. It just does the action of sending an email and by sending an email, they really mean print to the console. So we're going to Write Right. Our function. It has three input parameters. The name. And we should include string. It has the prize. And it has a Boolean. So those are the three pieces. That's the function prototype if I copy this. I'm not going to write the whole thing and we'll see the problem that exists with the testing that will be fixed.arrow_forward
- IN C PROGRAMMING LANGUAGE AND COMMENT EVERY STEP PLEASE Write a program that takes verbs and forms their past tense on the basis of these rules: a. If verb ends in “e”, add “d”. b. If verb ends in “ss” or “gh”, add “ed”. c. In all other cases, inform the user that the verb may have an irregular past tense. Print each verb and its past tense. Try the following data: smile discuss confess declare laugh run cough teach buyarrow_forwardUse Java.arrow_forwardWrite a function which increments a string to create a new string. • If the string ends with a number, the number should be incremented by 1. • If the string doesn't end with a number, 1 should be added to the new string. • If the number has leading zeros, the amount of digits should be considered. Examples incrementString("foo") → "fool" incrementString("foobar0009") incrementString("foo099") → "foo100" → "foobar0010"arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning