/* studentPay.cpp computes a student worker's pay.
 *
 * Input: A student's name, id number, hourly wage, hours worked.
 * Precondition: hoursWorked >= 0.0 && hoursWorked <= 40 &&
 *                hourlyWage > 0.0 && idNumber > 0.
 * Output: The student's name, id number, and pay.
 *******************************************************************/

#include <iostream>         // cin, cout, <<, >>
#include <string>           // string
#include <iomanip>          // fixed, showpoint, setprecision()
using namespace std;

int main()
{
  const double HOURLY_WAGE = 6.75;
  
  cout << "\nEnter the student's name (last, first, middle initial): ";
  string lastName, firstName;
  char middleInitial;
  cin >> lastName >> firstName >> middleInitial;
  
  cout << "Enter their id number: ";
  int idNumber;
  cin >> idNumber;
  
  cout << "Enter their hours this pay period: ";
  double hours;
  cin >> hours;
  
  double pay = hours * HOURLY_WAGE;
  
  cout << "\nName: " << firstName << ' ' << middleInitial << ". " << lastName
       << "\nId Number: " << idNumber
       << "\nPay: $" << fixed << showpoint << setprecision(2) 
       << pay << '\n';

  return 0;
}
