fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. //Define variables for calculation
  5. int EmployeeID;
  6. double HoursWorked;
  7. double RatePerHour;
  8. double GrossSalary;
  9. //Ask user for input
  10. cout << "Enter Employee ID: ";
  11. cin >> EmployeeID;
  12. cout << "Enter Hours Worked by Employee in one week: ";
  13. cin >> HoursWorked;
  14. cout << "Enter Hourly Rate for Employee: ";
  15. cin >> RatePerHour;
  16. //Display header
  17. cout << "********************************************" << endl;
  18. cout << "Author: Nathan Hocking" << endl;
  19. cout << "Program Name: Nathan_Project1.cpp" << endl;
  20. cout << "Date: October 5th, 2024" << endl;
  21. cout << "College Name: Long Beach City College (LBCC)" << endl;
  22. cout << "********************************************" << endl;
  23. //Return user input
  24. cout << "Employee ID: " << EmployeeID << endl;
  25. cout << "Hours Worked: " << HoursWorked << endl;
  26. cout << "Rate per Hour: " << RatePerHour << endl;
  27. //Salary is hours worked in a week times hourly rate
  28. GrossSalary = HoursWorked * RatePerHour;
  29. cout << "Gross Salary: $" << GrossSalary << " / week";
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 5284KB
stdin
10
20
30
stdout
Enter Employee ID: Enter Hours Worked by Employee in one week: Enter Hourly Rate for Employee: ********************************************
Author: Nathan Hocking
Program Name: Nathan_Project1.cpp
Date: October 5th, 2024
College Name: Long Beach City College (LBCC)
********************************************
Employee ID: 10
Hours Worked: 20
Rate per Hour: 30
Gross Salary: $600 / week