Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your third miniquest - Enter Now you'll weave the previous functions together with a third to create a fun experience. You must implement: void enter

Your third miniquest - Enter
Now you'll weave the previous functions together with a third to create a fun experience. You must implement:
void enter();
which should communicate with the user via the console. It has the following very tight script. You need to adhere to it as accurately as possible to score the most points.
1. Immediately upon being invoked, it must curtly greet the user (via std::cout) using the string "What?"Note that there is no space after the question mark. It must be followed by one newline.
2. Then enter an infinite loop. In each iteration of this loop,
a. You must read a whole line of input from the user and respond to each as below
(sequence is important, and responses must end in a newline)
b. If the user's input is an empty string, you must print the "What?" line again and
short-circuit back to the top of the loop (skip the rest of the steps below).
c. Print 4 spaces followed by the user's input and two newlines.
d. If the user input contains an exclamation mark(!), you must print the line
"OMG! You don't say!! " followed by the user input and exactly five
exclamation marks. Then revert to the top of the loop.
e. If the user input contains either of the words "why" or "what", you must print
the string "I'm sorry, I don't like questions that contain what or why." Then
revert to the top of the loop.
f. If the user input contains the letter s, then you must print two lines as follows
and then revert to the top of the loop.
i. "Interethting. When did you thtop thtopping your thibilanth?"

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

e. What difficulties did they encounter?

Answered: 1 week ago

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago