Question: QUICK ANSWER*** please modify this code so it matches what the prompt is asking for #include #include #include using namespace std; class PayRaise { public:
QUICK ANSWER*** please modify this code so it matches what the prompt is asking for
#include
using namespace std;
class PayRaise { public: PayRaise(char * = " " , float = 0.0, float = 0.0); ~PayRaise(); void printData(); void calcBonus(float);
private: char name[20]; float oldpay, raiseper, raiseamount, newpay;
};
PayRaise::PayRaise(char *n, float o, float rp) { strcpy(name, n); oldpay = o; raiseper = rp; raiseamount = oldpay*raiseper/100; newpay = oldpay + raiseamount;
}
PayRaise::~PayRaise() { cout
void PayRaise::printData() { cout
}
void PayRaise::calcBonus(float bonusamount) {
oldpay += bonusamount; raiseamount = oldpay*raiseper/100; newpay = oldpay+ raiseamount;
}
int main() {
PayRaise p ("Corby Bryan", 50000, 10); p.printData();
cout>bonus;
p.calcBonus(bonus); p.printData(); cout
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
