sourcefile won't compile getting errors

Feb 13, 2015 at 1:37am
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
struct Date
{
int month;
int day;
int year;
};

struct EmployeeInfo
{
int id;
string firstname;
string lastname;
Date birthday;
Date datehired;
double payrate;
int hours;
};

int main()
{
EmployeeInfo employee;
double grosspay, tax, netpay, totalgp=0, totaltax=0, count=0;
cin >> employee.id >> employee.firstname >> employee.lastname >> employee.birthday.month>>employee.birthday.day>>employee.birthday.year>>employee.datehired.month>>employee.datehired.day>>employee.datehired.year>>employee.payrate>>employee.hours;
while (count<10)
{
grosspay = employee.payrate * employee.hours;
if(grosspay>=1000)
tax = .25*grosspay;

else
{
tax = .18*grosspay;
}
netpay = grosspay - tax;

count++;
totalgp+= grosspay;
totaltax+= tax;
}
cout<<employee.id << employee.firstname << employee.lastname << employee.birthday.month <<employee.birthday.day<<employee.birthday.year<< employee.datehired.month<<employee.datehired.day<<employee.datehired.year << employee.payrate << employee.hours << tax << netpay << totalgp << totaltax<<endl;
return 0;
}

i'm compiling this on putty (unix) and it's giving me some errors such as "warning: no new line at end of file IN function 'int main () ': error: expected '}' at end of input...Anyone see the problem ?
Feb 13, 2015 at 2:30am
Please do not post more than once:
http://www.cplusplus.com/forum/beginner/156516/
Feb 13, 2015 at 2:31am
@LB I posted in the wrong section.
Feb 13, 2015 at 2:41am
For future reference, you can click the "Edit Topic" button at the top of your post and then move your topic to the correct forum. It's too late for that now, though - we will continue with the other topic.
Feb 18, 2015 at 7:50am
There is no error in your code I compiled it on my machine and it worked fine. use a better compiler
Topic archived. No new replies allowed.