Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

C++Groucho Marx used to have a game show called "You Bet Your Life" in which he would have a conversation with the contestant and try to get him or her to say a specified "magic word." If the...

1 answer below »


C++Groucho Marx used to have a game show called "You Bet Your Life" in which he would have a conversation
with the contestant and try to get him or her to say a specified "magic word." If the contestant said the magic
word, a duck would drop down, signaling that the contestant had won a prize. This program deals with a
similar game, which will have a specified set of magic words. The input consists of several passages of text.
Read in each passage, see if it includes all the magic words, and print whether or not the person wins the
prize. You must use a binary search tree ADT to store the magic words from the “Magic.txt” file to speed up
searching for these magic words.
Input
1. The magic words are listed, one word per line, in the text file "Magic.txt".
Example of the “Magic.txt” file:
rosebud
programming
rainbow
GeeksProgramming
To: You ( XXXXXXXXXX)
Monday, April 25th 2022, 2:03:39 PM PDTfish
hashtag
tweet
1. The text passages are input from a second text file, "TextPass.txt". Each line in this text file starts with a
number indicating what type of data this is where 1 is the contestants name and 2 is a text passage. You
will want to ignore passage ending punctuation such as “!” and “?”. There can be more than one
contestant in the “TextPass.txt” file.
Example of two contestants in the “TextPass.txt” file:
1 Bob
2 What am I doing here?
1 Mary
2 I am about to tweet hashtag rainbow fish.
Output
1. print the list of magic words.
2. print each section as it is read. Label the contestant's name.
3. In processing each text passage, keep track of which magic words were said, and at the end of the
section, print out one of the following messages:
Congratulations, name>, you have won the prize.
Sorry, name>, you failed to say the following magic words:
list of unsaid magic words>
Answered 8 days After Apr 25, 2022

Solution

Uhanya answered on May 04 2022
105 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here