fork download
  1. //*******************************************************
  2. //
  3. // Homework: 2
  4. //
  5. // Name: Jalen Tam
  6. //
  7. // Class: C Programming, Fall 2025
  8. //
  9. // Date: September 19, 2025
  10. //
  11. // Description: Program which determines gross pay
  12. // and outputs are sent to standard output (the screen).
  13. //
  14. //
  15. //********************************************************
  16. #include <stdio.h>
  17.  
  18. int main() {
  19.  
  20. int employees;
  21. int clockNumber;
  22. float wage;
  23. float hours;
  24. float grossPay;
  25.  
  26. printf("Input number of employees to process: ");
  27. scanf("%d", &employees);
  28.  
  29. for(int i = 0; i < employees ; i++){
  30. printf("Enter employee number: ");
  31. scanf("%06d", &clockNumber);
  32. printf("Enter employee wage: ");
  33. scanf("%f", &wage);
  34. printf("Enter hours worked: ");
  35. scanf("%f", &hours);
  36.  
  37. grossPay = wage * hours;
  38.  
  39. printf(" Clock#: %06d\n Wage: %f\n Hours: %4.2f\n Gross Pay: %4.2f\n", clockNumber,
  40. wage, hours, grossPay);
  41.  
  42. }
  43.  
  44. return 0;
  45. }
Success #stdin #stdout 0.01s 5320KB
stdin
5
98401 10.60 51.0
526488 9.75 42.5
765349 10.50 37.0
34645 12.25 45.0
127615 8.35 0.0
stdout
Input number of employees to process: Enter employee number: Enter employee wage: Enter hours worked:  Clock#: 098401
 Wage: 10.600000
 Hours: 51.00
 Gross Pay: 540.60
Enter employee number: Enter employee wage: Enter hours worked:  Clock#: 526488
 Wage: 9.750000
 Hours: 42.50
 Gross Pay: 414.38
Enter employee number: Enter employee wage: Enter hours worked:  Clock#: 765349
 Wage: 10.500000
 Hours: 37.00
 Gross Pay: 388.50
Enter employee number: Enter employee wage: Enter hours worked:  Clock#: 034645
 Wage: 12.250000
 Hours: 45.00
 Gross Pay: 551.25
Enter employee number: Enter employee wage: Enter hours worked:  Clock#: 127615
 Wage: 8.350000
 Hours: 0.00
 Gross Pay: 0.00