Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

struct employeeType; { nameType name; string empID; addressType address; dateTyp

ID: 3641572 • Letter: S

Question








struct employeeType;
{
nameType name;
string empID;
addressType address;
dateType hireDate;
dateType quitData;
contactType contact;
string deptID;
double salary;
};

write a program that prompts the user to enter in the employee information and confirm that the data has been entered into the correct members by outputting all of the data to the screen. You must use at least 1 function to read in or print out the data. im not sure how to make the function or rather what parameters to use

Explanation / Answer

I'm assuming this is somewhat similar to what you had planned. I didn't change your employee structure at all. However, I did defined the ones that you declared like nameType,addressTyp...etc, but did not define yourself. Modify at your own discretion. Already tested, but not fully tested. It compiles and runs. #include using namespace std; struct nameType { string firstName; string lastName; }; struct addressType { int number; string street; }; struct dateType { int month; int day; int year; }; struct contactType { string mobile; string email; }; struct employeeType { nameType name; string empID; addressType address; dateType hireDate; dateType quitDate; contactType contact; string deptID; double salary; }; //The paramater that you should use is the stuct employeeType void read_in(employeeType& employee) { //The stuct allows you to group closely realated data into one entity //note: to access the members of the stuct you use the . operator cout > employee.name.firstName >> employee.name.lastName; cout > employee.empID; //Input address cout > employee.address.number >> employee.address.street; //Input the date of hire cout > employee.hireDate.month >> employee.hireDate.day >> employee.hireDate.year; //Input the date of quit cout > employee.quitDate.month >> employee.quitDate.day >> employee.quitDate.year; //Input contact info cout > employee.contact.mobile; cout > employee.contact.email; //Input department ID cout > employee.deptID; //Input employee salary cout > employee.salary; } void read_out(employeeType employee) { cout