Question: I've been stuck on this and I need help. I need to write this is C + + . The first case doesn't work but

I've been stuck on this and I need help. I need to write this is C++. The first case doesn't work but the second case does work. I'm confused and stuck. Pleaes help.
Goal: Understand how to use a while loop to control and process text input by the user.
Assignment: Assume a string variable input has been declared and initialized empty. Write a loop that continuously prompts the user for a username. The loop will keep running until the user inputs a username longer than 8 characters.
Setup
Compile
IO test - Case 1
Description
The output is not correct. Check the diff viewer to see where it does not match the expected output.
More information
Input:
test
thibaut
thibautt
Expected in output:
Actual output:
thibautt
Warning:
The program timed out.
IO test - Case 2
More information
Input:
hello
test
olmo
sam
youri
codegrade
Expected in output:
Actual output:
codegrade
codegrade
I've been stuck on this and I need help. I need

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!