fork download
  1. // Marvyn De La Torre CS1A Chapter 2, Page 81, #6
  2.  
  3. /****************************************************************
  4.  * ANNUAL PAY
  5.  * --------------------------------------------------------------
  6.  * This program calculates an employee's annual pay based on
  7.  * their pay amount and number of pay periods in one year.
  8.  ****************************************************************
  9.  * INPUT
  10.  * payAmount : Amount earned each pay period
  11.  * payPeriods : Number of pay periods in one year
  12.  *
  13.  * OUTPUT
  14.  * annualPay : Employee's total annual pay
  15.  ****************************************************************/
  16.  
  17. #include <iostream>
  18. using namespace std;
  19.  
  20. int main()
  21. {
  22. double payAmount; // INPUT - Amount earned each pay period
  23. double payPeriods; // INPUT - Number of pay periods per year
  24. double annualPay; // OUTPUT - Employee's annual pay
  25.  
  26. // Assign the given values
  27. payAmount = 1700.0;
  28. payPeriods = 26.0;
  29.  
  30. // Calculate annual pay
  31. annualPay = payAmount * payPeriods;
  32.  
  33. // Display result
  34. cout << "The employee's annual pay is $" << annualPay << endl;
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
The employee's annual pay is $44200