/* employee0.cpp
   	Use a struct to store employee info. into a single instance.
      Also show how to initialize struct values when declaring them

	Output is:
      Please enter first, last, wage, sex: Dale Reed 6 M
      Information entered was: Dale Reed 6 M

      Second person's information is: Fernando Lopez 14 M


 */
#include <iostream>
using namespace std;

const int Size = 15;

struct Employee{
   char first[ Size];   // first name
   char last[ Size];    // last name
   float wage;          // hourly wage
   char sex;            // M for male, F for female
};


int main()
{
   Employee person;  // Note we can simply list the type as: Employee
                     //    and don't need to list it as: struct Employee

   cout << "Please enter first, last, wage, sex: ";
   cin >> person.first >> person.last >> person.wage >> person.sex;

   cout << "Information entered was: ";
   cout << person.first << " "
        << person.last << " "
        << person.wage << " "
        << person.sex 
        << "\n\n";

   // Show how we can initialize when declaring
   Employee secondPerson = {"Fernando", "Lopez", 14, 'M'};
   cout << "Second person's information is: ";
   cout << secondPerson.first << " "
        << secondPerson.last << " "
        << secondPerson.wage << " "
        << secondPerson.sex 
        << "\n\n";

   return 0;
}
