0
Hi guys can you help me on this what header should i put on this:??
#include <iostream> #include <string> const NO_OF_WORK_DAYS = 20; //5 days per wk * 4 wks per month const WORK_HR_PER_DAY = 8; //8hours per day work const RATE_PER_HR = 20; const NUMBER_OF_HRS_WORKED = WORK_HR_PER_DAY * NO_OF_WORK_DAYS; const MEDICARE = 100; const PAGIBIG = 200; std::string employeeName = "Juan"; unsigned basicPay = NUMBER_OF_HRS_WORKED * RATE_PER_HR; float sss = 0.03 * basicPay; unsigned totalDeduction = sss + MEDICARE + PAGIBIG; const takeHomePay = basicPay - totalDeduction; //Printing
2 Answers
+ 3
You don't need to include any other header, you just need to put the data type after "const", like below:
const int NO_OF_WORK_DAYS = 20; //5 days per wk * 4 wks per month
const int WORK_HR_PER_DAY = 8; //8hours per day work
const int RATE_PER_HR = 20;
const int NUMBER_OF_HRS_WORKED = WORK_HR_PER_DAY * NO_OF_WORK_DAYS;
const int MEDICARE = 100;
const int PAGIBIG = 200;
std::string employeeName = "Juan";
unsigned basicPay = NUMBER_OF_HRS_WORKED * RATE_PER_HR;
float sss = 0.03 * basicPay;
unsigned totalDeduction = sss + MEDICARE + PAGIBIG;
const int takeHomePay = basicPay - totalDeduction;
You may need to change to more appropriate data type.
0
thanks in this case if I try to run this it will work