Program using structs
Help in me designing my little project ....
i don't knw wht to do with this
Write a program that declares a struct Employee. Employee contains following
data members:
char fName[20] // contains first name of the employee
char lName[20] // contains last name of the employee
int bYear; // contains year of birth of the employee. Value range: 1950 to 1990
char bMonth[4] // contains month of birth of the employee e.g. JAN, JUL, DEC
int bDay // contains date (day) birth of the employee. Value range: 1-31
int jYear; // contains joining year of employee. Value range: 1950 to 2009
char jMonth[4] // contains joining month of employee e.g. JAN, FEB, JUN, DEC
int jDay // contains joining date (day) of employee. Value range: 1-31
long salary // contains salary of the employee. Value Range 10000-100000
Define following functions:
1- initEmployee(……) that initializes an object of Employee. (No user Defined Values
here)
2- viewEmployee(…..) that displays all the data members of an object of Employee.
3- addEmployee(…..) that takes values from user and stores it in an object of
Employee.
4-main() that contains following instructions:
Code:
void main()
{
Employee emp;
initEmployee(emp);
viewEmployee(emp);
addEmployee(emp);
viewEmployee(emp);
getch();
}
Last edited by jackprw1; 01-13-2010 at 06:27 AM.
|