/* employeeNested.cpp
   	Use a Nested structs to store employee info. 

	Output is:
      Please enter last, first, city, state, zip , wage for employee:
      Sanchez Sunil Chicago IL 60607 50000
      Employee information is:
      Sanchez, Sunil, Chicago, IL, 60607, 50000

		
 */

#include <iostream>
using namespace std;

// Global constants
const int ArraySize = 5;
const int NameSize = 15;

// Global structs
struct Address {
   char city[ NameSize];
   char state[ 2];
   int zip;          // make sure that an int on your machine can store 5-digit large numbers
};

struct Employee {
   char last[ NameSize];
   char first[ NameSize];
   Address theAddress;     // the nested struct
   float wage;
};


int main()
{
   Employee anEmployee;  // A single employee (you could have an array of these if you wanted)

   // enter information into the employee
   cout << "Please enter last, first, city, state, zip , wage for employee:";
   cin >> anEmployee.last 
       >> anEmployee.first 
       >> anEmployee.theAddress.city
       >> anEmployee.theAddress.state
       >> anEmployee.theAddress.zip
       >> anEmployee.wage;

   // echo information for this employee
   cout << "Employee information is: \n";
   cout << anEmployee.last << ", "
        << anEmployee.first  << ", "
        << anEmployee.theAddress.city << ", "
        << anEmployee.theAddress.state << ", "
        << anEmployee.theAddress.zip << ", "
        << anEmployee.wage;
   cout << "\n";

   return 0;
}

