SlideShare a Scribd company logo
1 of 3
Program Description Adjust program II to make use of methods. All the same rules from the
previous program specifications still apply, for example input gathering, output formatting and
breaking on -1 still apply. Write a method that prompts the user for hours worked, rate and name.
Use parameter passing, and pass by reference. Write a method that calculates the gross, base and
overtime pay, pass by reference. Write a method that calculates tax, taking as input the gross pay,
returning the tax owed. Calculate the total amount paid (gross pay) for all 5 people. Use the
return value from the method that calculates the gross pay. Write a print method that generates
the output, including the total amount paid, in addition to the data for each employee. Example
(Sample input & output for one person) Enter name: Glenn Enter hourly rate: 2.00 Enter hours
worked: 50 Enter name: -1 Pay to: Glenn Hours worked: 50.0 Hourly rate: $ 2.00 Gross pay:
$110.00 Base pay: $ 80.00 Overtime pay: $ 30.00 Taxes paid: $ 22.00 Net pay: $ 88.00 Total
Paid to all employees = $110.00 (The grand total of payments out.)
Solution
#include <stdio.h>
main()
{
char name[25];
float rate = 0;
float hours = 0;
float basePay = 0;
float overTime = 0;
float grossPay = 0;
float netPay = 0;
int i;
for(i = 0; i < 5; i++) {
printf(" What is your name? ");
scanf("%s", &name);
printf(" How much is your hourly pay? ");
scanf("%f", &rate);
printf(" How many hours did you work this week? ");
scanf("%f", &hours);
basePay = rate * hours;
grossPay = rate * 40 + (basePay - overTime);
overTime = (basePay - (1.5 * rate));
netPay = grossPay - (0.20 * grossPay);
if (hours > 40){
printf(" Pay for %s ", name);
printf(" Hourly rate:t $%.2f ", rate);
printf(" Hours worked:t $%.2f ", hours);
printf(" Gross pay:t $%.2f ", grossPay);
printf(" Taxes paid:t $%.2f ", 0.20 * grossPay);
printf(" Base pay:t $%.2f ", basePay);
printf(" Overtime pay:t $%.2f ", overTime);
printf(" Net pay:t $%.2f ", netPay);
}
else {
printf(" Pay for %s ", name);
printf(" Hourly rate:t $%.2f ", rate);
printf(" Hours worked:t $%.2f ", hours);
printf(" Gross pay:t $%.2f ", basePay);
printf(" Taxes paid:t $%.2f ", 0.20 * basePay);
printf(" Base pay:t $%.2f ", basePay);
printf(" Overtime pay:t $0.00 ");
printf(" Net pay:t $%.2f ", basePay -(basePay * 0.20));
}
}
}

More Related Content

Similar to Program II Payroll Methods

Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7alish sha
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop kapil078
 
Arithmetic and Arithmetic assignment operators
Arithmetic and Arithmetic assignment operatorsArithmetic and Arithmetic assignment operators
Arithmetic and Arithmetic assignment operatorsimtiazalijoono
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 
Java Language.....pdf
Java Language.....pdfJava Language.....pdf
Java Language.....pdfbadshetoms
 
I need help to modify my code according to the instructions- Modify th.pdf
I need help to modify my code according to the instructions- Modify th.pdfI need help to modify my code according to the instructions- Modify th.pdf
I need help to modify my code according to the instructions- Modify th.pdfpnaran46
 
Operating system labs
Operating system labsOperating system labs
Operating system labsbhaktisagar4
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
 
Video Case 1.2 throu 5.21.21. Why is the link between.docx
Video Case 1.2 throu 5.21.21.   Why is the link between.docxVideo Case 1.2 throu 5.21.21.   Why is the link between.docx
Video Case 1.2 throu 5.21.21. Why is the link between.docxdickonsondorris
 
programming for programs solving using C language
programming for  programs solving using C languageprogramming for  programs solving using C language
programming for programs solving using C languagesushma chinta
 
Oop project report using c++
Oop project report using c++Oop project report using c++
Oop project report using c++Lameck Elias
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements loopingMomenMostafa
 
Week 03 Lesson 02 recursive data definitions everywhere
Week 03 Lesson 02 recursive data definitions everywhereWeek 03 Lesson 02 recursive data definitions everywhere
Week 03 Lesson 02 recursive data definitions everywhereMitchell Wand
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solutionKuntal Bhowmick
 
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESUnit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESLeahRachael
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureOdoo
 

Similar to Program II Payroll Methods (20)

Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop
 
Introduction to c part -1
Introduction to c   part -1Introduction to c   part -1
Introduction to c part -1
 
Arithmetic and Arithmetic assignment operators
Arithmetic and Arithmetic assignment operatorsArithmetic and Arithmetic assignment operators
Arithmetic and Arithmetic assignment operators
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 
Java Language.....pdf
Java Language.....pdfJava Language.....pdf
Java Language.....pdf
 
I need help to modify my code according to the instructions- Modify th.pdf
I need help to modify my code according to the instructions- Modify th.pdfI need help to modify my code according to the instructions- Modify th.pdf
I need help to modify my code according to the instructions- Modify th.pdf
 
Operating system labs
Operating system labsOperating system labs
Operating system labs
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
Programming egs
Programming egs Programming egs
Programming egs
 
Looping
LoopingLooping
Looping
 
Na payroll
Na payrollNa payroll
Na payroll
 
Video Case 1.2 throu 5.21.21. Why is the link between.docx
Video Case 1.2 throu 5.21.21.   Why is the link between.docxVideo Case 1.2 throu 5.21.21.   Why is the link between.docx
Video Case 1.2 throu 5.21.21. Why is the link between.docx
 
programming for programs solving using C language
programming for  programs solving using C languageprogramming for  programs solving using C language
programming for programs solving using C language
 
Oop project report using c++
Oop project report using c++Oop project report using c++
Oop project report using c++
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements looping
 
Week 03 Lesson 02 recursive data definitions everywhere
Week 03 Lesson 02 recursive data definitions everywhereWeek 03 Lesson 02 recursive data definitions everywhere
Week 03 Lesson 02 recursive data definitions everywhere
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solution
 
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESUnit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll Structure
 

More from todd921

Question 1 2 points Save Team building is designed to gather.docx
Question 1  2  points    Save    Team  building is designed to gather.docxQuestion 1  2  points    Save    Team  building is designed to gather.docx
Question 1 2 points Save Team building is designed to gather.docxtodd921
 
Question 21 2 points Save How do training and development with.docx
Question  21  2 points   Save    How do training and development with.docxQuestion  21  2 points   Save    How do training and development with.docx
Question 21 2 points Save How do training and development with.docxtodd921
 
QS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docxQS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docxtodd921
 
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docxQ1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docxtodd921
 
Q- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docxQ- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docxtodd921
 
PYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docxPYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docxtodd921
 
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docxPurchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docxtodd921
 
Provide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docxProvide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docxtodd921
 
Provide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docxProvide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docxtodd921
 
Provide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docxProvide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docxtodd921
 
proposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docxproposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docxtodd921
 
Programming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxProgramming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxtodd921
 
Question 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docxQuestion 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docxtodd921
 
Question 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docxQuestion 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docxtodd921
 
Question 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docxQuestion 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docxtodd921
 
Question 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docxQuestion 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docxtodd921
 
Question 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docxQuestion 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docxtodd921
 
Question 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docxQuestion 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docxtodd921
 
Question 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docxQuestion 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docxtodd921
 
QUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docxQUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docxtodd921
 

More from todd921 (20)

Question 1 2 points Save Team building is designed to gather.docx
Question 1  2  points    Save    Team  building is designed to gather.docxQuestion 1  2  points    Save    Team  building is designed to gather.docx
Question 1 2 points Save Team building is designed to gather.docx
 
Question 21 2 points Save How do training and development with.docx
Question  21  2 points   Save    How do training and development with.docxQuestion  21  2 points   Save    How do training and development with.docx
Question 21 2 points Save How do training and development with.docx
 
QS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docxQS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docx
 
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docxQ1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
 
Q- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docxQ- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docx
 
PYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docxPYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docx
 
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docxPurchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docx
 
Provide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docxProvide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docx
 
Provide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docxProvide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docx
 
Provide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docxProvide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docx
 
proposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docxproposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docx
 
Programming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxProgramming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docx
 
Question 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docxQuestion 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docx
 
Question 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docxQuestion 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docx
 
Question 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docxQuestion 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docx
 
Question 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docxQuestion 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docx
 
Question 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docxQuestion 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docx
 
Question 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docxQuestion 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docx
 
Question 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docxQuestion 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docx
 
QUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docxQUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docx
 

Recently uploaded

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 

Recently uploaded (20)

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 

Program II Payroll Methods

  • 1. Program Description Adjust program II to make use of methods. All the same rules from the previous program specifications still apply, for example input gathering, output formatting and breaking on -1 still apply. Write a method that prompts the user for hours worked, rate and name. Use parameter passing, and pass by reference. Write a method that calculates the gross, base and overtime pay, pass by reference. Write a method that calculates tax, taking as input the gross pay, returning the tax owed. Calculate the total amount paid (gross pay) for all 5 people. Use the return value from the method that calculates the gross pay. Write a print method that generates the output, including the total amount paid, in addition to the data for each employee. Example (Sample input & output for one person) Enter name: Glenn Enter hourly rate: 2.00 Enter hours worked: 50 Enter name: -1 Pay to: Glenn Hours worked: 50.0 Hourly rate: $ 2.00 Gross pay: $110.00 Base pay: $ 80.00 Overtime pay: $ 30.00 Taxes paid: $ 22.00 Net pay: $ 88.00 Total Paid to all employees = $110.00 (The grand total of payments out.) Solution #include <stdio.h> main() { char name[25]; float rate = 0; float hours = 0; float basePay = 0; float overTime = 0; float grossPay = 0; float netPay = 0;
  • 2. int i; for(i = 0; i < 5; i++) { printf(" What is your name? "); scanf("%s", &name); printf(" How much is your hourly pay? "); scanf("%f", &rate); printf(" How many hours did you work this week? "); scanf("%f", &hours); basePay = rate * hours; grossPay = rate * 40 + (basePay - overTime); overTime = (basePay - (1.5 * rate)); netPay = grossPay - (0.20 * grossPay); if (hours > 40){ printf(" Pay for %s ", name); printf(" Hourly rate:t $%.2f ", rate); printf(" Hours worked:t $%.2f ", hours); printf(" Gross pay:t $%.2f ", grossPay); printf(" Taxes paid:t $%.2f ", 0.20 * grossPay); printf(" Base pay:t $%.2f ", basePay); printf(" Overtime pay:t $%.2f ", overTime); printf(" Net pay:t $%.2f ", netPay);
  • 3. } else { printf(" Pay for %s ", name); printf(" Hourly rate:t $%.2f ", rate); printf(" Hours worked:t $%.2f ", hours); printf(" Gross pay:t $%.2f ", basePay); printf(" Taxes paid:t $%.2f ", 0.20 * basePay); printf(" Base pay:t $%.2f ", basePay); printf(" Overtime pay:t $0.00 "); printf(" Net pay:t $%.2f ", basePay -(basePay * 0.20)); } } }