Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started