fork(1) download
  1. /*
  2. Homework: 1
  3.  
  4. Name:Robert Richard
  5.  
  6. CLass: C programming <Spring 2023>
  7.  
  8. Date: 1/26/2023
  9.  
  10. Description: Program which determines gross pay and the
  11. output is sent to standard output (the screen)
  12. */
  13.  
  14.  
  15. #include <stdio.h>
  16. int main()
  17. {
  18. int clockNum;
  19. float grossPay;
  20. float hoursWorked;
  21. float hourlyWage;
  22. printf ("This is a program to calculate gross pay.\n");
  23. printf ("You will be prompted for employee data.\n\n");
  24. printf ("Enter clock number for employee: ");
  25. scanf ("%d", &clockNum);
  26. printf ("Enter hourly wage for employee: ");
  27. scanf ("%f", &hourlyWage);
  28. printf ("Enter the number of hours the employee worked: ");
  29. scanf ("%f", &hoursWorked);
  30.  
  31. grossPay = hourlyWage * hoursWorked;
  32.  
  33. printf ("\n\t\tC Programming, First Homework Assignment\n\n\n");
  34. printf ("\t----------------------------------------------------------\n");
  35. printf ("\tClock # Wage Hours Gross\n");
  36. printf ("\t----------------------------------------------------------\n");
  37.  
  38. printf ("\t%06i %5.2f %5.1f %7.2f\n",
  39. clockNum, hourlyWage, hoursWorked, grossPay);
  40. return 0;
  41. }
  42.  
Success #stdin #stdout 0s 5476KB
stdin
Standard input is empty
stdout
This is a program to calculate gross pay.
You will be prompted for employee data.

Enter clock number for employee: Enter hourly wage for employee: Enter the number of hours the employee worked: 
		C Programming, First Homework Assignment


	----------------------------------------------------------
	Clock # Wage Hours Gross
	----------------------------------------------------------
	021881  0.00  -0.0   -0.00