Question: PLEASE USE C++ Write a program that will ask the user for a string of no more than 9 characters in length o This string

PLEASE USE C++

Write a program that will ask the user for a string of no more than 9 characters in length o This string should only contain the characters A,B,C,D

You need to write a function that will try to guess the inputted string by trying all possible combination of A,B,C,D until it guesses the correct string

Your program should print out every string the program has tried followed by ---incorrect or ---correct

YOU ARE NOT ALLOWED TO USE ANY LOOPS IN YOUR PROGRAM

You must write at least three functions

int main() o Which is the main function. Keep it brief

A recursion function that checks that the string only contains A,B,C and Ds in it

A recursion function for guessing the inputted string. This function must be recursive and cannot create new strings, vectors or any other object.

If you pass in an object ( string, vector, ect) to this function you must pass it by reference. Note: string.resize() is very useful for this assignment. In a string char 0 will not be printed with a std::cout.

SAMPLE OUT

Enter in a string (between 0 and 9 characters):

AAAAAABDC ----incorrect

A----incorrect

AAAAAABDC----correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!