Brock T.

asked • 03/08/22

Old Deaf Professor C++ coding assignment

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
}


1 Expert Answer

By:

Donald W. answered • 03/08/22

Tutor
5.0 (214)

Experienced and Patient Tutor for Math and Computer Science

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.