fork download
  1. //OrinTill Qimid CS1A Chapter 4, P. 294, 4
  2. //
  3. /**************************************************************
  4.  * CALCULATE GROSS WAGE
  5.  *
  6.  * ____________________________________________________________
  7.  * This program will calcuate the gross wage for the employees.
  8.  * ____________________________________________________________
  9.  * INPUT
  10.  * hours : the amount of hours employee worked.
  11.  * payrate : the payrate of each employees.
  12.  * OUTPUT
  13.  * wages : the gross wages.
  14.  **************************************************************/
  15. #include <iostream>
  16. #include <iomanip>
  17. #include <cmath>
  18. using namespace std;
  19.  
  20.  
  21.  
  22. int main()
  23. {
  24. int empId[] =
  25. {5658845, 4520125, 7895122, 8777541,
  26. 8451277, 1302850, 7580489};
  27. float hours [7];
  28. double payrate[7];
  29. double wages[7];
  30. for (int i = 0; i < 7; i++)
  31. {
  32. cout<<"please enter the payrate for employee number "<<empId[i]<<endl;
  33. cin>> hours[i];
  34. cout<<"please enter the amount of hours for employee number "<<empId[i]<<endl;
  35. cin>> payrate[i];
  36. wages [i]= hours[i] * payrate[i];
  37. }
  38. for (int s = 0; s < 7; s++)
  39. {
  40. cout<<"employee number: "<<empId[s]<<endl;
  41. cout<<"gross wages: "<<wages[s]<<endl;
  42. }
  43.  
  44.  
  45.  
  46.  
  47. return 0;
  48. }
  49.  
  50.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty