Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I've tried to do the program but the out didn't come out properly It didn't fetch the value for epf_deduction and BonusReward in DisplayTotal 3.

image text in transcribed

I've tried to do the program but the out didn't come out properly

image text in transcribed

It didn't fetch the value for epf_deduction and BonusReward in DisplayTotal

image text in transcribed

3. Write a complete C program to calculate total pay which includes net salary and bonus. Listed below are functions that need to be included in your program.: void BasicSalary() - Ask user to enter basic salary. void EPF (double) - To calculate the amount of employees evident fund (EPF) deduction from basic salary. void CalculateBonus (double) - To calculate the amount of bonus. Assume bonus is half of basic salary. double DisplayTotalPay (double, double) - To calculate the total pay after EPF deduction and bonus reward. 4 Your program output should be like below: Please enter your salary: 1200 Please enter the percentage of EPF deduction : 11 Your EPF deduction is RM132.00 Your bonus (half of salary) is RM600.00 Your total pay is RM1200.00 - RM132.00 + RM600.00 = RM1668.00 _ C:\Users\User\Documents\UTM'S\SECBH\SECJ1013 - Programming Technique 1\hanum.cpp - Dev-C++ 5.11 File Search View Project Execute Tools Style Window Help Edit TDM-GCC 4.9.2 64-bit Release (globals) 6 7 array ex58.cpp hanum.cpp 1 #include 2 float salary, epf, epf_deduction, BonusReward, TotalPay; 3 4 void Basicsalary() 55 printf("Please enter your salary : "); scanf("%f" , &salary); 8 } 9 1e void EPF(double epf_deduction) { printf(" Please enter the percentage of EPF deduction : "); scanf("%f" , &epf); epf_deduction= (epf/108) *salary; 15 printf(" Your EPF deduction is RM%.2f ", epf_deduction); } void calculateBonus (double BonusReward) { BonusRewardsalary/2; printf(" your bonus (half of salary) is RM%.2f ", Bonus Reward); } double DisplayTotalPay(double epf_deduction, double Bonus Reward) { TotalPay= (salary)-(epf_deduction)+(BonusReward); printf(" your total pay is RM%.2f - RM%.2f + RM%.2f = RM%.2f" , salary, epf_deduction, Bonus Reward, TotalPay); } int main() 31 BC Basicsalary(); EPF(epf_deduction); CalculateBonus (Bonus Reward); DisplayTotalPay (epf_deduction, Bonus Reward); 27 Compiler Resources dh Compile Log Debug Find Results Close hot Comitation Line: 36 Col: 2 Sel: 0 Lines: 37 Length: 917 Insert Done parsing in 0.047 seconds W DEV C++ 1 ca ) ENG 9:35 AM 28-Dec-20 _ C:\Users\User Documents\UTM'S\SECBH\SECJ1013 - Programming Technique1\hanum.cpp - [Executing] - Dev-C++ 5.11 File Search View Project Execute Tools AStyle Window Help Edit TDM-GCC 4.9.2 64-bit Release (globals) array ex58.cpp hanum.cpp C:\Users\User\Documents\UTM'S\SECBH\SECJ1013 - Programming Technique1\hanum.exe 13 EPF(epf_deduction 14 CalculateBonus (B.Please enter your salary : 1200 15 DisplayTotalPay ( 16 } Please enter the percentage of EPF deduction : 11 17 18 void Basicsalary() Your EPF deduction is RM132.00 19 { 20 printf("Please enyour bonus (half of salary) is RM600.00 21 scanf("%f" , &sal 22 } Your total pay is RM1200.00 RM0.00 + RM0.00 = RM1200.00 23 24 void EPF(double epf-Process exited after 7.095 seconds with return value o 25 { 26 printf(" Please Press any key to continue 27 scanf("%f" , &epf) 28 epf_deduction= ( 29 printf(" Your EP 30 } 31 32 void CalculateBonus(d 33 { 34 Bonus Reward= sala 35 printf(" Your bo 36 } 37 38 double DisplayTotalpa 39 0 40 41 TotalPay= (salary 42 printf(" Your to 43 88 Compiler Resources a compleLog v Debug Find Results Close Whort comnilotion Line: 43 Col: 2 Sel: 0 Lines: 43 Length: 1037 Insert Done parsing in 0.016 seconds W DEV 1 ca ) ENG 9:32 AM 28-Dec-20

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions