lab4 - #include using namespace std; /* struct...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
using namespace std; /* struct Employee { int age; int id; float salary; int getAge() {return age;}; int getId() {return id;}; float getSalary() {return salary;}; }; } void PrintEmployee(Employee[],int); v void main() { Employee employee[2]; int EmployeeCount=2; i cout<<"Please enter the age, id, and salary of the first employee."<<endl; cout<<"Age: "; cin>> employee[0].age; cout<<"Id: "; cin>>employee[0].id; cout<<"Salary: "; cin>>employee[0].salary; c cout<<"Please enter the age, id, and salary of the second employee."<<endl; cout<<"Age: "; cin>> employee[1].age; cout<<"Id: "; cin>>employee[1].id; cout<<"Salary: "; cin>>employee[1].salary; cout<<endl; c PrintEmployee(employee, EmployeeCount); } void PrintEmployee(Employee employee[2],int EmployeeCount) { for(int Count=0;Count<EmployeeCount;Count++) { cout<<"The age of Employee "<<Count+1<<" is "<<employee[Count].getAge()<<"."<<endl; cout<<"The Id of Employee "<<Count+1<< " is "<<employee[Count].getId()<<"."<<endl; cout<<"The salary of Employee "<<Count+1<< " is
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/25/2010 for the course CECS CIS 200 taught by Professor Jieshen during the Winter '08 term at University of Michigan-Dearborn.

Page1 / 3

lab4 - #include using namespace std; /* struct...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online