### Recent Question/Assignment

Question 01
A mobile manufacturing company pays its employees as follows: 1) Team leaders (fixed fortnightly salary)
2) Sales workers (\$500 plus 6.5% of their gross fortnightly sales)
3) Pieceworkers (fixed amount of money per item for each of the items they produce, each piece worker in this company works on only 1 type of item)
4) Hourly workers (fixed hourly wage for up to the first 60 hours they work and -timeand a-half- i.e. 1.5 times their hourly wage, for overtime hours worked)
Write a program to compute the weekly pay for each employee. You do not know the number of employees in advance.
Each type of employee has its own pay code:
Code 2: Sales workers
Code 3: Pieceworkers
Code 4: Hourly workers
There will be an undetermined number of entries into the payroll. Use a switch to compute each employees pay based on that employees pay code. Within the switch, prompt the user (i.e. the payroll clerk) to enter the appropriate facts your program needs to calculate each employees pay based on that employees pay code. Print each pay value and when done with the entries, print total amount of payroll.
Sample Run:
Enter employees number code (-1 to end): 4
Enter hourly workers pay rate: 10 Enter the number of hours worked: 35 fortnightly pay is: 350.00
Enter employees number code (-1 to end): 4
Enter hourly workers pay rate: 15.5 Enter the number of hours worked: 100 fortnightly pay is: 1860
Enter employees number code (-1 to end): 4
Enter hourly workers pay rate: 10 Enter the number of hours worked: 40 fortnightly pay is: 400.00
Enter employees number code (-1 to end): 1
fortnightly pay is: 576.90
Enter employees number code (-1 to end): 2 Enter Sales employees gross weekly sales: 1091.45 fortnightly pay is: 570.94
Enter employees number code (-1 to end): 3
Enter the number of pieces completed: 200 Enter the employees per piece pay rate: 0.5 fortnightly pay is: 100
Enter employees number code (-1 to end): 8 You have entered an invalid code.
Enter employees number code (-1 to end): 9 You have entered an invalid code.
Enter employees number code (-1 to end): 3
Enter the number of pieces completed: 100 Enter the employees per piece pay rate:
2.75 fortnightly pay is: 275.00
Enter employees number code (-1 to end): -1
The total payroll for the fortnight is:4132.84
Question 02
Use the rand function to produce two positive one-digit integers (0 includes). The program should then prompt the user with a question, such as How much is 2 + 3?
er. If
1. Very good!
2. Excellent!
3. Nice work!
4. Keep up the good work!
If the answer is wrong, randomly display any of the following messages.
2. Wrong. Try once more.
3. Dont give up!
4. No. Keep trying and let the user try the same question repeatedly until the user finallygets it right.
A separate function should be used to generate each new question. This function should be called once when the application begins execution and each time the user answers the question correctly.
(Hint: Use random-number generation to choose a number from 1 to 4 that will be used to select one of the four appropriate responses to each correct or incorrect answer. Use a switch statement to issue the responses.)
Question 03
Question 04
Write a complete C program to calculate area and circumference of a circle. Your program should have the following functions in addition to a main() function.
Do you want to use radius or diameter for the calculation?
Enter 2 for diameter
Enter -1 to exit