Answer to Question #166623 in C++ for Anoymous

Question #166623

Create a program that will prompt the user to enter the name (first and last) of a person that can serve as a reference for a job application. The name will be confirmed on screen and the prompt will keep appearing until the user types "exit". At the end, the total # of references will be shown.

 

Output:

Enter the full name of a person that can serve as a reference (type 'exit' to quit):   [user types: Arthur Morgan]

Arthur Morgan is reference #1

Enter the name of another person that can serve as a reference (type 'exit' to quit):   [user types: Sadie Adler]

Sadie Adler is reference #2

Enter the name of another person that can serve as a reference (type 'exit' to quit):   [user types: John Marston]

John Marston is reference #3

Enter the name of another person that can serve as a reference (type 'exit' to quit):  [user types: exit]


You have a total of 3 references

 

Notes and Hints:

1) You MUST use a WHILE LOOP

2) Hint: Remember which function was needed to store a user entry that contained a space? Forgot? Check the Chp 3 outline.

 


1
Expert's answer
2021-02-25T14:31:15-0500
#include<iostream>
using namespace std;
int main(){
char    first[20],last[20],exit[6];

    while(exit!="exit"){
cout<<"Enter first and last name"<<endl;
cin>>first>>last;
cout<<"type exit to quit"<<endl;
cin>>exit;
if(exit=="exit"){break;}
    }

return 0;}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment