Zoom
of triangle. The function should return -1 for invalid triangle.
2. Write a function that calculates the total year-end bonus each employee receives based on their sales under the following conditions: if your annual sales are below $100,000, you will only receive a year-end bonus of $1,000. If your sales are between $100,000 and $120,000, you will receive 1% of the amount exceeding $100,000. If your sales are between $120,000 and $140,000, you will receive 2% of the amount exceeding $120,000. If your sales exceed $140,000,you will receive 3% of the amount exceeding $140,000.(2 marks).
3. Write a function to calculate S according to the following formula (n > 0): (2 marks)
1!2!3!1+1+1+2+√1+√2+1+2+3+√1+√2+√3n!1+2+...n + √1 + √2 + √3 + ... + √n S = ++
4. Write a function that returns a list of even elements and sorts them in ascending order from an unsorted array of integers (1.5 marks)
. Write main() function to invoke the 4 functions above:5
+ Offertext menu for user choice to execute the functions. (1 mark)
+ For each choice, demonstration of successfully running the selected function (0.5 mark for each).
Note:
1. Students are only allowed to use DevC++ software and offline documents (on personal computers)
2. Students only submit a single source code file named PRF192_FA24.c
3. The program must run without any compile errors or the student will get zero marks. (theprogram cannot run).
Close
+ 108%