{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

H4-solutions

Cis 247c homework h4 solutions 3272012 height 60400

Info iconThis preview shows pages 3–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS-247C Homework H4 solutions 3/27/2012 Height" ,60,4.00); Student s2( "400-00-0004" , "Prince, Pat" , 'M' ,19, "Addison" ,48,3.54); Student s3( "777-77-7777" , "Spear, Britney" , 'F' ,22, "Naperville Central" ,66,3.50); Student s4( "600-00-0006" , "Crosby, Bin" , 'M' ,31, "Westmont Central" ,58,2.20); Student s5( "300-00-0003" , "Firby, Mary" , 'F' ,25, "Lombard North" ,73,3.75); Student s6( "100-00-0001" , "Carlen, Joan" , 'F' ,27, "ElmTech" ,45,1.94); // display all student objects cout << "\nReport#2 - All student objects:\n" ; s1.getData(); s2.getData(); s3.getData(); s4.getData(); s5.getData(); s6.getData(); // change teachers' salaries t1.changeSalary(); t2.changeSalary(); t3.changeSalary(); t4.changeSalary(); // display all teacher objects again cout << "\nReport#3 - All teacher objects:\n" ; t1.getData(); t2.getData(); t3.getData(); t4.getData(); // change students' GPA s1.changeGPA(); s2.changeGPA(); s3.changeGPA(); s4.changeGPA(); s5.changeGPA(); s6.changeGPA(); // display all student objects again cout << "\nReport#4 - All student objects:\n" ; s1.getData(); s2.getData(); s3.getData(); s4.getData(); s5.getData(); s6.getData(); return 0; } H41 – Output: H42 (or iLab4) – Program Source Code: //************************************************************** **** // iLab 4 //************************************************************** **** #include <iostream> #include <iomanip> #include <string> #include <stdlib.h> usingnamespace std; class Benefit
Background image of page 3

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

View Full Document Right Arrow Icon
CIS-247C Homework H4 solutions 3/27/2012 { private : string healInsure; double lifeInsure; int vacDays; public : Benefit() { healInsure= "not provided" ; lifeInsure=0.0; vacDays=14; } Benefit(string h, double l, int v) { healInsure=h; lifeInsure=l; vacDays=v; } { healInsure = my.healInsure; lifeInsure = my.lifeInsure; vacDays = my.vacDays; } void setHealInsure(string h) { healInsure=h; } void setLifeInsure( double l) { lifeInsure=l; } void setVacDays( int v) { vacDays= v; } void setBenefit(string h, double l, int v) { healInsure=h; lifeInsure=l; vacDays=v; } string getHealInsure() { return healInsure; } double getLifeInsure() { return lifeInsure; } int getVacDays() { return vacDays; } void getBenefit() { cout<< "\nBenefit Information\n" ; cout<< "=============================================\n" ; cout<< "Health Insurance:\t" <<healInsure << "\n"
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page3 / 8

CIS 247C Homework H4 solutions 3272012 Height 60400 Student...

This preview shows document pages 3 - 5. Sign up to view the full document.

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