Question: C++ Questions about code. I have bolded the lines I have a question on, and my questions are italisized and bolded. Please explain as best
C++ Questions about code. I have bolded the lines I have a question on, and my questions are italisized and bolded. Please explain as best as you can, maybe use other examples. #include#include //why doesn't it work as just '#include #include? using namespace std; class PayRaise { public: PayRaise(char * = " " , float = 0.0, float = 0.0); ~PayRaise(); void printData(); //what exactly is printData? Where does it come from? What's it doing? void calcBonus(float); private: char name[20]; float oldpay, raiseper, raiseamount, newpay; }; PayRaise::PayRaise(char *n, float o, float rp) // what's the two colons? { strcpy(name, n); oldpay = o; raiseper = rp; raiseamount = oldpay*raiseper/100; //I don't really get this bolded part. Please explain what you can newpay = oldpay + raiseamount; } PayRaise::~PayRaise() { cout<<"the name of "< 2)< 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
