Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a recursive function called void reverse ( ) that reverses a sentence. You need to create a class called Sentence that includes the

C++ Write a recursive function called void reverse ( ) that reverses a sentence. You need to create a class called Sentence that includes the recursive function called reverse along with a display function and a default constructor for the class. It is up to you as the programmer to determine the private member variables. Your program should create an Object in the main function and call reverse string function. For example:

Sentence greeting = new Sentence ("Hello!"); greeting.reverse ( ); cout << greeting.get_text() << " ";

Display on the Screen: !olleH

Note: Make sure the reverse string function does implement a recursive solution and does not include a for or while loop.

2. Modify the Object Oriented program you just completed so that your program is able to read several different sentences from a file then make a call using the greeting object so that each sentence will display in a reverse order. Use your own test case sentences to test your program.

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_2

Step: 3

blur-text-image_3

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

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago