Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Write a function for c++ that accepts a word as an input argument (type string) and generates several different scrambles of the word. (Output

4. Write a function for c++ that accepts a word as an input argument (type string) and generates several different scrambles of the word. (Output to the screen.) The input word can be from 4 to 10 letters in length. The number of scrambles produced depends on the number of letters in the word. e.g. the 4 letter word lose would have 4 different scrambles produced and the seven letter word edition would have seven different scrambles.

Here is a candidate example: Input: FLOOR

Possible Scrambles: ROOLF, OOLFR, OLFRO, LOORF, OORFL

Your function must use the same block of code for each input word. (That is you cannot test for the word length and then have special code depending on the result.) You have a number of tools available to assist with this including the reverse string operation you did in homework three. There is also the rand() random number generator available. Come up with your own algorithm for this problem. PLEASE DO NOT USE VECTOR NOTATION.

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions