Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that prints the message, Hello, my name is Hal! Then, on a new line, the program should print the message What
Write a program that prints the message, "Hello, my name is Hal!" Then, on a new line, the program should print the message "What would you like me to do?" Then it's the user's turn to type in an input. You haven't yet learned how to do it-just use the following lines of code: string user input; getline(cin, user input); Finally, the program should ignore the user input and print the message "I am sorry, I cannot do that." This program uses the string data type. To access this feature, you must place the line #include before the main function. Here is a typical program run. The user input is printed in color. Hello, my name is Hal! What would you like me to do? Clean up my room I am sorry, I cannot do that. When running the program, remember to press the Enter key after typing the last word of the input line.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started