Solution to Pls help me to implement this program #include <iostream> using namespace struct NameType { string … - Sikademy
Author Image

Archangel Macsika

Pls help me to implement this program #includeusing namespace struct NameType { string first; string middle; string last; }; struct AddressType { string address1; string address2; string city; string state; string zip; }; struct DateType { int month; int day; int year; }; struct ContactType { string phone; string cellphone; string fax; string pager; string email; }; struct EmployeeType { NameType name; string emp_id; AddressType address; DateType hireDate; DateType quitDate; ContactType contact; };

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


#include <iostream> using namespace std; #define NO_OF_EMP 3 struct NameType { string first; string middle; string last; }; struct AddressType { string address1; string address2; string city; string state; string zip; }; struct DateType { int month; int day; int year; }; struct ContactType { string phone; string cellphone; string fax; string pager; string email; }; struct EmployeeType { NameType name; string emp_id; AddressType address; DateType hireDate; DateType quitDate; ContactType contact; }; int main() { int n=0; struct EmployeeType E[NO_OF_EMP]; E[n].name.first  = "abc"; E[n].name.middle = "lmn"; E[n].name.last   = "xyz"; E[n].emp_id      = "1234"; E[n].address.address1 = "A1"; E[n].address.address2 = "A2"; E[n].address.city     = "C1"; E[n].address.state    = "S1"; E[n].address.zip      = "123456"; E[n].hireDate.day     = "26"; E[n].hireDate.month   = "02"; E[n].hireDate.year    = "2020"; E[n].quitDate.day     = "26"; E[n].quitDate.month   = "02"; E[n].quitDate.year    = "2020"; E[n].contact.cellphone="1234567890"; E[n].contact.email    ="[email protected]"; E[n].contact.fax      ="1234567890"; E[n].contact.pager    ="1234567890"; E[n].contact.phone    ="1234567890"; return(0); }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1084-qpid-80