{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab4 - #include using namespace std struct...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream> 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 "<<employee[Count].getSalary()<<"."<<endl<<endl; } } */ * class Employee { public: int age;
Image of page 1

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

View Full Document Right Arrow Icon
int id; float salary; public: void setAge(int x); void setId(int x);
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern