Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Programming Language to be used is C++ Problem 4- Simple sentence manipulation (10 points) Write a program that reads a sentence that ends with

image text in transcribed

The Programming Language to be used is C++

Problem 4- Simple sentence manipulation (10 points) Write a program that reads a sentence that ends with a period. The sentence should have plus symbols wherever you would expect there to be spaces. It outputs the sentence with all 'e' letters replaced by and all plus symbols are replaced by spaces. Here is an example (user input has been underlined): Please enter a sentence ending with a period: Hello +my+nametistGeorae. H*llo, my nam* is G*org*. HINTS: The key to doing this is making good use of the cin buffer. Essetially you want to do the following loop: do f read one letter off the cin buffer print the letter (maybe altered, e.g. e->*) while (you haven't seen the period); Remember that as soon as the program displays "Please enter a sentence ending with a period", the user types their sentence and hits enter. This means that: All the letters they have typed are sitting on the cin buffer waiting to be used All the letters that you print will automatically go on the next line (since the user hit enter after typing his/her sentence)

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

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions