Concepts tested: reading strings, string comparisons, character functions, selection statements, using loops for user interaction, break and continue statements
Write a program that does the following.
1) Prompts the user to have a conversation of indeterminate length with the old deaf professor (statements entered into console by user)
2) The conversation starts with the prof saying "HEY KID!"
3) If the user says something with any lowercase letters, the prof responds with "SPEAK UP, KID!""
4) If the user says something with NO lowercase letters, the prof responds with "NO, NOT SINCE 1946!"
5) The first time the user says "GOODBYE!"" the prof says LEAVING SO SOON?
6) If the user says "GOODBYE!" a second time consecutively the prof says "LATER SKATER!" and the program ends. (if the user says something other than GOODBYE! after the first GOODBYE!, the count resets and it's like GOODBYE! was never said)
7) User must be able to enter a full sentence (not just a single word)
8) All statements by the prof must end with a new line / endl
Here is an example conversation (input / output):
HEY KID!
hey
SPEAK UP KID!
can you hear me?
SPEAK UP KID!
CAN YOU HEAR ME?
NO, NOT SINCE 1946!
GOODBYE!
LEAVING SO SOON?
YES
NO, NOT SINCE 1946!
GOODBYE!
LEAVING SO SOON?
GOODBYE!
LATER SKATER!
Code:
#include <iostream>
// OTHER INCLUSIONS
using namespace std;
int main()
{
//YOUR_CODE
}