Hello Progression

////////////////////////////////// **** ////////////////////////////////////////
// Author : Wyatt Date : 1/1/2000
// Purpose: To say hello
// Design: greet user

#include <iostream>
using namespace std;

int main ( )
{

  // display message.
  cout << "Hi! We hope you enjoy studying C++." << endl;
  return 0;
}
////////////////////////////////// **** ////////////////////////////////////////
// Author : Wyatt Date : 1/1/2000
// Purpose: To ask a user's name and to say hello
// Design: Ask Name
//         Store name
//         greet user using stored name

#include <iostream>
using namespace std;

int main ( )
{
 // Local Data 
 string firstName;	//input variable

  // Enter name and display message.
  cout << "Enter your first name and press return: ";
  cin  >> firstName;
  cout << "Hi " << firstName << '.' << endl;
  cout << "We hope you enjoy studying C++." << endl;
  return 0;
}

////////////////////////////////// **** ////////////////////////////////////////
// Author : Wyatt Date : 1/1/2000
// Purpose: To ask a user's name and to say hello  with an IF
// Design: Ask Name
//         Store name
//         greet user using stored name
//         if name is joe
//           say "nice name

#include <iostream>
using namespace std;

int main ( )
{
 // Local Data 
 string firstName;	//input variable

  // Enter name and display message.
  cout << "Enter your first name and press return: ";
  cin  >> firstName;
  cout << "Hi " << firstName << '.' << endl;
  cout << "We hope you enjoy studying C++." << endl;

  // joseph??
  if (firstName == "joseph")
     cout << "Nice name!" << endl;
  return 0;
}
////////////////////////////////// **** ////////////////////////////////////////
// Author : Wyatt Date : 1/1/2000
// Purpose: To ask a user's name and to say hello  with an IF / ELSE
// Design: Ask Name
//         Store name
//         greet user using stored name
//         if name is joe
//           say "nice name

#include <iostream>
using namespace std;

int main ( )
{
 // Local Data 
 string firstName;	//input variable

  // Enter name and display message.
  cout << "Enter your first name and press return: ";
  cin  >> firstName;
  cout << "Hi " << firstName << '.' << endl;
  cout << "We hope you enjoy studying C++." << endl;

  // joe??
  if (firstName == "joe")
     cout << "Nice name!" << endl;
  else
     cout << "oh well..." << endl;  
  
  return 0;
}

////////////////////////////////// **** ////////////////////////////////////////
// Author : Wyatt Date : 1/1/2000
// Purpose: To ask a user's name and to say hello with IF/ELSE IN A LOOP
// Design: 
/*      loop
           Ask Name
           Store name
           greet user using stored name
           if name is joe
             say "nice name
        until user doesn't want to continue
*/
    
#include <iostream>
using namespace std;

int main ( )
{
 // Local Data 
 string firstName;	//input variable
 char answer;
   do
   {
     // Enter name and display message.
     cout << "Enter your first name and press return: ";
     cin  >> firstName;
     cout << "Hi " << firstName << '.' << endl;
     cout << "We hope you enjoy studying C++." << endl;
   
     // joe??
     if (firstName == "joe")
        cout << "Nice name!" << endl;
     else
        cout << "oh well..." << endl;  

     // ask and get answer
     cout << "again? (y/n) "; 
     cin >> answer;
   while(answer == 'y');

  return 0;
}