Write a program to complete the employeeType struct on page 576. Prompt the user
ID: 3535125 • Letter: W
Question
Write a program to complete the employeeType struct on page 576. Prompt the user to input a employee's
#include
"stdafx.h"
#include
<iostream>
int
_tmain(int argc, _TCHAR* argv[])
{
struct
employee
 
{
char
first[30],midd[30],last[30],add[30],city[30],state[30],email[30];
int
id,zip,day,month,year,salary,dept_id,phone;
};
 
void
main()
;
employee mem;
float
sal;
 
cout<<
"enter employee first middle and last name";
cin>>mem.first>>mem.mid>>mem.last;
cout<<
"enter add city/state of a employee";
cin>>mem.add>>mem.city>>mem.state;
cout<<
"enter email id of employee";
cin>>mem.email;
cout<<
"enter id zip code month day and year of joining salary dept_id and phone no";
cin>>mem.id>>mem.zip>>mem.month>>mem.day>>mem.year>>mem.salary>>mem.dept_id>>mem.phone;
 
 
 
 
 
 
cout<<
"detail of employee is ";
cout<<
" Name -"<<mem.first<<" "<<mem.mid<<" "<<mem.last;
cout<<
" emp id "<<mem.id;
cout<<
" address is "<<mem.add<<" "<<mem.city<<" "<<mem.state<<" "<<mem.zip;
cout<<
" date hired "<<mem.date<<"/"<<mem.month<<"/"<<mem.year;
cout<<
" phone "<<mem.phone;
cout<<
" email "<<mem.email;
cout<<
" dept id "<<mem.dept_id;
sal=mem.salary/12;
cout<<
" monthly salary is "<<sal;
cout<<
" yearly salary is "<<mem.salary;
}
 
 
return 0;
}
Explanation / Answer
#include #include int _tmain(int argc, _TCHAR* argv[]) { struct employee { char first[30],midd[30],last[30],add[30],city[30],state[30],email[30]; int id,zip,day,month,year,salary,dept_id,phone; }; void main() { // here!!!! employee mem; float sal; cout>mem.first>>mem.mid>>mem.last; cout>mem.add>>mem.city>>mem.state; cout>mem.email; cout>mem.id>>mem.zip>>mem.month>>mem.day>>mem.year>>mem.salary>>mem.dept_id>>mem.phone; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.