Question: / / PLACE YOUR NAME HERE #include using namespace std; int main ( ) { char letter = ' a ' ; while ( letter

// PLACE YOUR NAME HERE
#include using namespace std;
int main(){
char letter ='a';
while (letter !='x'){
cout << "Please enter a letter" << endl;
cin >> letter;
cout << "The letter you entered is "<< letter << endl;
}
return 0; }
Exercise 1: This program is not user friendly. Run it a few times and explain why.
Exercise 2: Add to the code so that the program is more user friendly. Exercise 3: How would this code affect the execution of the program if the
while loop is replaced by a do-while loop? Try it and see.

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!