void myGlutDisplay( void ) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glTranslatef( obj_pos[0], obj_pos[1], -obj_pos[2] ); glMultMatrixf(view_rotate); glRotatef(angr/2,0,1,0); glLightfv(GL_LIGHT0, GL_DIFFUSE, vCafeClaro); glLightfv(GL_LIGHT0, GL_AMBIENT, vCafeClaro); glPushMatrix(); glRotatef(90,1,0,0); glTranslatef(-12,-12,6.9); mosaico(5,5,5,piso); glPopMatrix(); glPushMatrix(); glRotatef(-135,0,1,0); mike(); glPopMatrix(); std::string text = "Eric Garcia Perez, Motion Captures. Press Esc to exit."; drawText(text.data(), text.size(), 0, 600-10); glPopMatrix(); glFlush (); glutSwapBuffers(); }
int main() { Manager man; Employee dan(1, "Dan"); Employee mike(2, "Mike"); Employee alex(3, "Alex"); Employee sarah(4, "Sarah"); dan.setBoss(man); mike.setBoss(man); alex.setBoss(man); sarah.setBoss(man); dan.work(2); mike.work(2); sarah.work(4); sarah.work(3); mike.work(8); alex.work(11); dan.report(); mike.report(); dan.work(7); mike.work(7); mike.work(5); sarah.work(7); alex.report(); sarah.report(); dan.work(5); dan.report(); man.report(); alex.work(4); alex.work(3); alex.work(7); dan.work(3); sarah.work(8); dan.report(); mike.report(); alex.report(); sarah.report(); dan.work(8); dan.work(7); man.report(); mike.work(11); mike.work(4); alex.work(7); alex.work(5); sarah.work(2); sarah.work(11); dan.report(); mike.report(); alex.report(); sarah.report(); man.report(); man.report(); return 0; }
int main() { Manager* man = new Manager; // Changed man to a pointer type Employee dan(1, "Dan"); Employee mike(2, "Mike"); Employee alex(3, "Alex"); Employee sarah(4, "Sarah"); dan.setBoss(man); mike.setBoss(man); alex.setBoss(man); sarah.setBoss(man); dan.work(2); mike.work(2); sarah.work(4); sarah.work(3); mike.work(8); alex.work(11); dan.report(); mike.report(); dan.work(7); mike.work(7); mike.work(5); sarah.work(7); alex.report(); sarah.report(); dan.work(5); dan.report();//1 man->report(); alex.work(4); alex.work(3); alex.work(7); dan.work(3); sarah.work(8); dan.report(); mike.report(); alex.report(); sarah.report(); dan.work(8); dan.work(7); man->report();//2 mike.work(11); mike.work(4); alex.work(7); alex.work(5); sarah.work(2); sarah.work(11); dan.report(); mike.report(); alex.report(); sarah.report(); man->report();//3 man->report();//4 return 0; }