Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi expert, this is question programming in c++ hope you can do the question in detailed and correctly so that i can understand and learn

Hi expert, this is question programming in c++ hope you can do the question in detailed and correctly so that i can understand and learn something from you expert.i really need explanation to get better understanding thank you expert, will vote ya

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

(c) The following program calculates the weekly salary for 3 type of workers namely manager, hourly worker and commission worker. The program however only calculates the salary for one worker only after the code for the worker has been entered 3/12 KIE1004 #include using namespace std; int main() ! int paycode, TotalHours pieces 1 double pay, HourlySalary, Piecewage, Weeklysalary. GrossWeeklySales) cout > paycode: while (paycode =4) cout > paycode: ) cout > WeeklySalary: cout > Hourlysalary: cout > Total Hours) if (Total Hours (40) pay - HourlySalary Total Hours: else (40.0 * Hourlysalary) + (HourlySalary + 1.5); pay - (Total Hours - 40) - cout > GrossWeeklySales; cout return 0; } Modify the codes so that the program will loop and requesting the code of the worker until 0 is entered to terminate the program. The program should also display the total salary of all workers when the program terminates. Below is the sample output after the modifications. Contoh keluaran/Sample output Enter paycode Enter 1 for Manager, 2 for Hourly Worker and 3 for Commission Worker. (O to end) : 1 Manager selected. Enter weekly salary: 800 The manager's pay is $ 800.00 Enter paycode Enter 1 for Manager, 2 for Hourly Worker and 3 for Commission Worker. (O to end): 5 Enter paycode Enter 1 for Manager, 2 for Hourly Worker and 3 for Commission Worker. (O to end) : 2 Hourly worker selected. Enter the hourly salary: 20 5/12 KIE 1004 Enter the total hours worked: 45 Worker's pay is $ 950.00 Enter paycode Enter 1 for Manager, 2 for Hourly Worker and 3 for Commission Worker. (O to end) : 0 Total salary for all workers is 1750.00 (6 markah 1 marks) ii. If the segments of the codes which has been underlined below are changed with two separate functions, write the appropriate function prototypes and function definitions for both functions. if (Total Hours

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions