Payroll.c - Kenneth M Col�n#include <stdio.h>#include <stdlib.h>/This program serves as a PayRoll systems form the user to efficiently get their own

Payroll.c - Kenneth M Col�n#include <stdio.h>#include...

This preview shows page 1 out of 1 page.

/* Kenneth M. Col n 07/2/2019*/ #include <stdio.h> #include <stdlib.h> //This program serves as a PayRoll systems form the user to efficiently get their own or employee's net pay after deductions. //this program is inspired by my own paystub/payroll in terms of outputted information. main(){ //declaring variables float hourlyRate = 0.0; //set by user float hoursWorked = 0.0; //set by user float regPay = 0.0; float otPay = 1.5; float grossPay = 0.0; float medInsc = 0.0; float fTax = 0.0; float netPay = 0.0; const float medInscRate = .14; const float fTaxRate = .27; char ch; do{ printf("Enter your Hourly Rate \n"); scanf("%f", &hourlyRate); printf("Enter the amount of hours worked \n"); scanf("%f", &hoursWorked); if(hoursWorked > 40){ //over time paid for evert hour over 40
Image of page 1

Unformatted text preview: regPay = hourlyRate * 40; otPay = (hoursWorked - 40) * hourlyRate * 1.5; printf(&quot;Your Over Time pay is: %f \n&quot;, otPay); //total of overtime } else{ regPay = hourlyRate * hoursWorked; otPay = 0; } grossPay = regPay + otPay; fTax = grossPay * fTaxRate; medInsc = grossPay * medInscRate; netPay = grossPay - medInsc - fTax; printf(&quot;Medical Insurance : %f &amp; Federal Tax: %f \n&quot;, medInsc, fTax); //total of each deduction printf(&quot;Total Earnings: %f \n&quot;, grossPay); //total without deductions printf(&quot;Your total NetPay is: %f \n&quot;, netPay); //total with deductions printf (&quot;Would you like make another payroll?: Y/N \n&quot;); //asks user if they would like to try again scanf (&quot; %c&quot;, &amp;ch); } while (ch == 'y' || ch == 'Y'); system(&quot;pause&quot;); }...
View Full Document

  • Spring '17

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask bonus questions You can ask questions ( expire soon) You can ask questions (will expire )
Answers in as fast as 15 minutes