Hi im trying to build this pay rate calculator but im getting a few errors:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
struct Time{
int hr, min;
char meridian;
};
struct Garage{
string name;
float rate;
Time time_in, time_out;
};
struct PayRecord{
string name;
string position;
int ssn;
int vacdays;
int weekly_hrs;
float weakly_sal;
};
int main(){
Garage car;
car.name = "Wednesday";
car.rate = 12.50;
cout<<"Enter time you parked your car (ie 12 30 a): ";
cin>>car.time_in.hr>>car.time_in.min>>car.time_in.meridian;
cout<<"Enter time you picked up your car (ie 12 30 a): ";
cin>>car.time_out.hr>>car.time_out.min>>car.time_out.meridian;
cout<<"THE RATES FOR THE GARAGE LISTED IS:"<<endl
<<"Day: \t\t" + car.name<<endl
<<"Rate: \t\t$"<<fixed<<setprecision(2)<<car.rate<<endl
<<"TimeIn: \t"<<car.time_in.hr<<":"<<car.time_in.min<<car.time_in.meridian<<"m"
<<endl
<<"TimeOut: \t"<<car.time_out.hr<<":"<<car.time_out.min<<car.time_out.meridian<<"m"
<<endl;
//////////////////////////////////////////////////////////////////////////////////////////////
const int NUM = 5;
//PayRecord staff[5];
PayRecord staff[NUM] = {
{"Alice", "CEO", 101, 10, 40, 25.00},
{"Bob", "Manager", 102, 5, 40, 15.00},
{"Carl", "Junior Manager", 103, 5, 35, 10.00},
{"Dan", "Sales Associate", 104, 2, 0, 8.50},
{"Ellen", "Sales Associate", 105, 1, 0, 8.50}
};
return 0;
}