SlideShare a Scribd company logo
1 of 16
MAKERERE UNIVERSITY
SCHOOL OF STATISTICS AND PLANNING
DEPARTMENT OF STATISTICAL METHODS
BACHELOR OF STATISTICS
AND
BACHELOR OF SC IN ACTUARIAL SCIENCE 2011/2012
GROUP 10
TASK
• A given organisation has 30 employees with a policy of no increase
nor decrease in the number of staff. You are required to design a
computer program that computes the net pay of employees. Note
that the system requires the following
• Identification number of employees
• Name of employees
• Sex
• Department
• Gross pay
• Birth day of employees
• Etc
• Note tax = 30% of the gross pay
REQUIRED
• A company requires a data base of its employees
with all the details of the employees including the
gross pay
• A computer program that computes the net pay of
employees putting into consideration the gross
pay and the tax rate of employees
• Note, in Uganda employees earning bellow
shs.130000 do not pay tax, in our program we
considered employees earning a gross pay bellow
shs.200000 do not pay tax
CHOICES AND DECISIONS
• We decided to use c programming language
when designing the program that computes the
net pay because of the following
1. C language is simple to learn and adopt to.
2. C language is portable, a program can be
designed on one system and be used on a
different system
STEPS IN DESIGNING THE PROGRAM
• After designing a database system of the 30
employees, we were in position to design the
program
• We calculated the tax paid by each employee
putting into consideration the gross pay earned
i.e. gross pay > 200000
Tax paid= 0.3 * gross pay
While gross pay < = 200000
Tax paid = shs.0
CONTINUATION
• After calculating the tax paid by each
employee,
We calculate the net pay of the employees
i.e. net pay = gross pay – tax paid
• from the above employees earning
shs.200000 and below do not pay tax and there
fore their
Net pay = gross pay
C TECHIQUES USED
• In the program we used a “for” loop to control the
number of employees to which the net pay is
calculated.
• All the details of the employee as got from a database
of the company are entered in the main function under
the “for” loop, like the name , sex and gross pay
• Our for loop statement has three parts, the part that
initialises the employee, its executed, then the second
condition if its true, the loop continues i.e. if the
number of employees is still less than 30, when the
second condition is wrong, the program exits the loop.
CONTINUATION OF THE TECHIQUES
• The “for” loop statement is nested as it
contains the “if” statement in it.
• The use of the “if ” statement is to control the
calculation of net pay, as it contains a Boolean
statement i.e. gross>200000 where if the
conditions is true, the calculation of the net
pay is executed but when the condition is false
the calculation are not executed as shown
above.
PROGRAM CYCLE
• Including a header statement.
• Initialising the size of employees to be considered
• Declaring local variables to be used in the
program
• Introducing the main function, and in the main
function we declared a “for” loop and an if
condition in it
• Entering the employee data form the data base i.e.
name, sex, department, gross pay.
• At the if condition we check whether the gross
pay is greater than 200000 and if yes tax is
calculated and net pay got by subtracting the tax
paid from gross pay
When the gross pay is less than 200000 or equal to
200000, the tax paid is zero(0) and thus the net
pay equals to the gross pay
At the end the program prints the name
department and gross pay plus net pay in tabulat
form.
CONCLUSION
• From above the program calculates the net pay
of the employees putting into consideration the
gross pay,
• The program is case sensitive on the amount
earned by each employees as those earning
shs.200000 and below
C program to calculate net pays

More Related Content

Similar to C program to calculate net pays

Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2Rohit malav
 
PAYROLL MANAGEMENT.pptx
PAYROLL MANAGEMENT.pptxPAYROLL MANAGEMENT.pptx
PAYROLL MANAGEMENT.pptxSuraj857568
 
PAYROLL MANAGEMENT (1).pptx
PAYROLL MANAGEMENT (1).pptxPAYROLL MANAGEMENT (1).pptx
PAYROLL MANAGEMENT (1).pptxSuraj857568
 
A computerized payroll system for the barangay hall
A computerized payroll system for the barangay hallA computerized payroll system for the barangay hall
A computerized payroll system for the barangay hallAcel Carl David O, Dolindo
 
ODTUG Configuring Workforce: Employee? Job? or Both?
ODTUG Configuring Workforce: Employee? Job? or Both? ODTUG Configuring Workforce: Employee? Job? or Both?
ODTUG Configuring Workforce: Employee? Job? or Both? Alithya
 
PPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptx
PPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptxPPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptx
PPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptxSuraj857568
 
Payroll management
Payroll managementPayroll management
Payroll managementAnita Yadav
 
ERPNext system (CubeTech)
ERPNext system (CubeTech)ERPNext system (CubeTech)
ERPNext system (CubeTech)noossaa
 
Payroll management system for Employee
Payroll management system for Employee Payroll management system for Employee
Payroll management system for Employee Chhabi Lal Garhewal
 
Learn to Create a Payroll Summary Report in QuickBooks.pptx
Learn to Create a Payroll Summary Report in QuickBooks.pptxLearn to Create a Payroll Summary Report in QuickBooks.pptx
Learn to Create a Payroll Summary Report in QuickBooks.pptxDancing Numbers
 
Interpreting your pennsylvania unemployment compensation (uc) contribution ra...
Interpreting your pennsylvania unemployment compensation (uc) contribution ra...Interpreting your pennsylvania unemployment compensation (uc) contribution ra...
Interpreting your pennsylvania unemployment compensation (uc) contribution ra...James Baker, SPHR Retired, MAS
 
Payroll process oracle hrms
Payroll process oracle hrmsPayroll process oracle hrms
Payroll process oracle hrmsShaju Shana
 
PF revised wage ceiling limit and its impact
PF revised wage ceiling limit and its impactPF revised wage ceiling limit and its impact
PF revised wage ceiling limit and its impactGreytip Software
 
Sap hcm payroll concept - Best SAP HR Training Institute in Pune
Sap hcm payroll concept - Best SAP HR Training Institute in PuneSap hcm payroll concept - Best SAP HR Training Institute in Pune
Sap hcm payroll concept - Best SAP HR Training Institute in PuneAspire Techsoft Academy
 
What is employee productivity ratio & How do you Calculate it
What is employee productivity ratio & How do you Calculate it What is employee productivity ratio & How do you Calculate it
What is employee productivity ratio & How do you Calculate it Time Doctor
 

Similar to C program to calculate net pays (20)

Payroll Sytem
Payroll SytemPayroll Sytem
Payroll Sytem
 
Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2
 
PAYROLL MANAGEMENT.pptx
PAYROLL MANAGEMENT.pptxPAYROLL MANAGEMENT.pptx
PAYROLL MANAGEMENT.pptx
 
PAYROLL MANAGEMENT (1).pptx
PAYROLL MANAGEMENT (1).pptxPAYROLL MANAGEMENT (1).pptx
PAYROLL MANAGEMENT (1).pptx
 
A computerized payroll system for the barangay hall
A computerized payroll system for the barangay hallA computerized payroll system for the barangay hall
A computerized payroll system for the barangay hall
 
ODTUG Configuring Workforce: Employee? Job? or Both?
ODTUG Configuring Workforce: Employee? Job? or Both? ODTUG Configuring Workforce: Employee? Job? or Both?
ODTUG Configuring Workforce: Employee? Job? or Both?
 
PPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptx
PPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptxPPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptx
PPPPPPPAYROLL_MANAGEMENT_SYSTEM_BOO.pptx
 
Payroll management
Payroll managementPayroll management
Payroll management
 
ERPNext system (CubeTech)
ERPNext system (CubeTech)ERPNext system (CubeTech)
ERPNext system (CubeTech)
 
Payroll
PayrollPayroll
Payroll
 
Payroll management system for Employee
Payroll management system for Employee Payroll management system for Employee
Payroll management system for Employee
 
2.8 payroll applications
2.8 payroll applications2.8 payroll applications
2.8 payroll applications
 
Learn to Create a Payroll Summary Report in QuickBooks.pptx
Learn to Create a Payroll Summary Report in QuickBooks.pptxLearn to Create a Payroll Summary Report in QuickBooks.pptx
Learn to Create a Payroll Summary Report in QuickBooks.pptx
 
Interpreting your pennsylvania unemployment compensation (uc) contribution ra...
Interpreting your pennsylvania unemployment compensation (uc) contribution ra...Interpreting your pennsylvania unemployment compensation (uc) contribution ra...
Interpreting your pennsylvania unemployment compensation (uc) contribution ra...
 
Payroll process oracle hrms
Payroll process oracle hrmsPayroll process oracle hrms
Payroll process oracle hrms
 
PF revised wage ceiling limit and its impact
PF revised wage ceiling limit and its impactPF revised wage ceiling limit and its impact
PF revised wage ceiling limit and its impact
 
Payroll processing
Payroll processingPayroll processing
Payroll processing
 
Sap hcm payroll concept - Best SAP HR Training Institute in Pune
Sap hcm payroll concept - Best SAP HR Training Institute in PuneSap hcm payroll concept - Best SAP HR Training Institute in Pune
Sap hcm payroll concept - Best SAP HR Training Institute in Pune
 
What is employee productivity ratio & How do you Calculate it
What is employee productivity ratio & How do you Calculate it What is employee productivity ratio & How do you Calculate it
What is employee productivity ratio & How do you Calculate it
 
Incentive plans
Incentive plansIncentive plans
Incentive plans
 

Recently uploaded

Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxWorkforce Group
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...amitlee9823
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...allensay1
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwaitdaisycvs
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfAdmir Softic
 
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...lizamodels9
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...lizamodels9
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876dlhescort
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 MonthsIndeedSEO
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceDamini Dixit
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...rajveerescorts2022
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon investment
 
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Anamikakaur10
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876dlhescort
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture conceptP&CO
 

Recently uploaded (20)

Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
Russian Call Girls In Rajiv Chowk Gurgaon ❤️8448577510 ⊹Best Escorts Service ...
 
Falcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in indiaFalcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in india
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
Call Now ☎️🔝 9332606886🔝 Call Girls ❤ Service In Bhilwara Female Escorts Serv...
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 

C program to calculate net pays

  • 1. MAKERERE UNIVERSITY SCHOOL OF STATISTICS AND PLANNING DEPARTMENT OF STATISTICAL METHODS BACHELOR OF STATISTICS AND BACHELOR OF SC IN ACTUARIAL SCIENCE 2011/2012 GROUP 10
  • 2. TASK • A given organisation has 30 employees with a policy of no increase nor decrease in the number of staff. You are required to design a computer program that computes the net pay of employees. Note that the system requires the following • Identification number of employees • Name of employees • Sex • Department • Gross pay • Birth day of employees • Etc • Note tax = 30% of the gross pay
  • 3. REQUIRED • A company requires a data base of its employees with all the details of the employees including the gross pay • A computer program that computes the net pay of employees putting into consideration the gross pay and the tax rate of employees • Note, in Uganda employees earning bellow shs.130000 do not pay tax, in our program we considered employees earning a gross pay bellow shs.200000 do not pay tax
  • 4. CHOICES AND DECISIONS • We decided to use c programming language when designing the program that computes the net pay because of the following 1. C language is simple to learn and adopt to. 2. C language is portable, a program can be designed on one system and be used on a different system
  • 5. STEPS IN DESIGNING THE PROGRAM • After designing a database system of the 30 employees, we were in position to design the program • We calculated the tax paid by each employee putting into consideration the gross pay earned i.e. gross pay > 200000 Tax paid= 0.3 * gross pay While gross pay < = 200000 Tax paid = shs.0
  • 6. CONTINUATION • After calculating the tax paid by each employee, We calculate the net pay of the employees i.e. net pay = gross pay – tax paid • from the above employees earning shs.200000 and below do not pay tax and there fore their Net pay = gross pay
  • 7. C TECHIQUES USED • In the program we used a “for” loop to control the number of employees to which the net pay is calculated. • All the details of the employee as got from a database of the company are entered in the main function under the “for” loop, like the name , sex and gross pay • Our for loop statement has three parts, the part that initialises the employee, its executed, then the second condition if its true, the loop continues i.e. if the number of employees is still less than 30, when the second condition is wrong, the program exits the loop.
  • 8. CONTINUATION OF THE TECHIQUES • The “for” loop statement is nested as it contains the “if” statement in it. • The use of the “if ” statement is to control the calculation of net pay, as it contains a Boolean statement i.e. gross>200000 where if the conditions is true, the calculation of the net pay is executed but when the condition is false the calculation are not executed as shown above.
  • 9. PROGRAM CYCLE • Including a header statement. • Initialising the size of employees to be considered • Declaring local variables to be used in the program • Introducing the main function, and in the main function we declared a “for” loop and an if condition in it • Entering the employee data form the data base i.e. name, sex, department, gross pay.
  • 10. • At the if condition we check whether the gross pay is greater than 200000 and if yes tax is calculated and net pay got by subtracting the tax paid from gross pay When the gross pay is less than 200000 or equal to 200000, the tax paid is zero(0) and thus the net pay equals to the gross pay At the end the program prints the name department and gross pay plus net pay in tabulat form.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. CONCLUSION • From above the program calculates the net pay of the employees putting into consideration the gross pay, • The program is case sensitive on the amount earned by each employees as those earning shs.200000 and below