i need to make a ipo chart plus provide a pseudocode in basic or alice for a pay
ID: 3536990 • Letter: I
Question
i need to make a ipo chart plus provide a pseudocode in basic or alice for a payroll program. the input would be payroll record First name, last name, employee number, hourly rate, hours worked and tools purchased, the output would be report full name, total hours worked, overtime hours worked, gross pay, taxes paid, tools purchased, and net pay. for definitions overtime is paid at 1.5 times hourly rate on hours worked over 40, federal taxes equal 15% of the gross pay, state taxes equal 4.6% of the gross pay, federal tax is always calculated and subtracted before state tax, and net pay equals gross pay minus taxes minus tools purchased. for processing ask for and recieve payroll record, calulate gross pay, calculate net pay, printpayroll report for the employee and end the program when employee numbeer 999 is entered
Explanation / Answer
100% correct answer.....JUST gO tHROUGH IT ONCE.........
#include<stdio.h>
void safer_geats(char array[], int max_chars)
{
float getOvertimePay();
float getFederalTax ();
float getgross_pay();
float getnetpay();
}
main()
{
float hours_worked, hourly_rate, gross_pay[10], overtime_pay, federal_tax[10];
float net_pay;
int x, num;
char first_last[10][30] = {" "};
printf("Welcome to the Payroll Calculator ");
printf("Enter the number of employees(1 - 10): ");
scanf("%i", &num);
printf(" ");
for(x = 0; x < num; ++x)
{
printf(" Enter the name for employee %i: ", x + 1);
scanf("%s", &first_last);
fflush(stdin);
printf("Enter the number of hours for %s: ", first_last);
scanf("%i", &hours_worked);
fflush(stdin);
printf("Enter the hourly rate for %s: ", first_last);
scanf("%i", &hourly_rate);
fflush(stdin);
if(hours_worked <= 40)
{
overtime_pay = gross_pay[10] * hours_worked * hourly_rate;
gross_pay[10] = hours_worked * hourly_rate;
}
else if(hours_worked > 40)
{
gross_pay[10] = 40 * hours_worked + (hourly_rate - 40) * hourly_rate * 1.5;
}/* End if loop */
}/* End for loop */
printf("Payroll Report ");
printf("---------------");
for(x = 0; x < num; ++x)
{
printf("%s ", first_last[x + 1]);
printf("Gross: $ %15.2f ", x + 1);
printf("Federal Tax: $ %15.2f ", x + 1);
printf("Net Pay: $ %15.2f ", x + 1);
}
getchar();
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.