1. 1
IN THE NAME OF ALLAH, THE MOST BENEFICENT, THE MOST MERCIFUL
DEPARTMENT OF ICT
CENTRE FOR FOUNDATION STUDIES, IIUM
SEMESTER I, SESSION 2013/2014
SEF1514 ASSIGNMENT 3
Student #1: ……………………………………………………….………. Matric No: ……….….…………
Student #2: ………………………………………………………….…… Matric No: …….….….…………
Group No: ……………..
Write a C program to display net weekly pay for a number of staff. Your program
must use the following user-defined functions:
Use your group number and matric number to name the program file.
e.g. “G101-112345-112346.c
Don’t use global declarations
Declare array for 5 staff names
Declare array for 5 staff week hours worked
Declare array for 5 staff net weekly pay
Declare symbolic constant for hourly waged to be 10 RM
Declare symbolic constant for tax rate to be 0.05
Declare other needed variables
From main() call the following functions to get inputs:
getHours() - to input number of hours worked for 5 staff.
Then main will call:
calculate() – to calculate the net weekly pay for the 5 staff. Use the
following formulas.
Weekly_Pay = week_hours_worked * hourly_wage
Net_Weekly_Pay = Weekly_Pay – (Tax_Rate * Weekly_Pay )
Then main() will pass net weekly pay to:
display()
- to print the Names and calculated net weekly pay
/ 30
2. 2
- Call function FindHighest() to return highest net weekly.
display() will display the highest net weekly pay
- Display name of highest net weekly pay
- Call function FindAvg() to return net weekly pay average.
display() will display the average.
Repeat the whole process until the user decided to stop.
Sample output:
Welcome to Net Weekly Pay Program
Programer 1: Mahmoud Al-Shawabkeh 112345
Programer 2: Azizul Azlan 112346
Group Number: G101
Enter week hours worked for 5 staff: 40
45
40
30
35
The names are Ahmad Ali Omar Fahmi Othman
The net weekly pay is 380 428 380 285 333
Highest net weekly pay is 428
Staff name of highest net weekly pay is Ali
Average of all net weekly pay is 361.2
Do you want to continue? <Y/y/N/n>: N
Press any key to continue . . .