help?

So I working on HW: compiling errors. So far I have come up with this


#include <string>
#include <iostream>
#include <iomanip>

using namespace std;
using std::cout;
using std::cin;
using std::endl;

//Global Declarations of Variables
double iovertime_hours = 0, iovertime_pay = 0, iovertime_extra = 0;
int ihours, iwage;
string cname;

int main ()
{
//Enter Employee Information
cout << "\n\nEnter the employee name = " << endl;
cin >> cname;
cout << "Enter the hours worked = " << endl;
cin >> ihours;
cout << "Enter his or her hourly wage = " << endl;
cin >> iwage;

// Determine if hours are greater than 40
if (ihours < 40.0)
{
//Do Calculations
iovertime_hours = ihours - 40.0;
iovertime_pay = iwage*1.5;
iovertime_extra = iovertime_hours + ihours;

// Display Employee Details
cout << "\n\n";
cout << "Employee Name ............. = " << cname << endl;
cout << "Base Pay .................. = " << iwage*40.0 << endl;
cout << "Hours in Overtime ......... = " << iovertime_hours << endl;
cout << "Overtime Pay Amout......... = " << iovertime_pay << endl;
cout << "Total Pay ................. = " << iovertime_extra + (40.0*iwage) << endl;
}
else // Else hours are less than 40 hours
{
cout << "\n\n";
cout << "Employee Name ............. = " << cname << endl;
cout << "Base Pay .................. = " << iwage*40.0 << endl;
cout << "Hours in Overtime ......... = " << iovertime_hours << endl;
cout << "Overtime Pay Amout......... = " << iovertime_pay << endl;
cout << "Total Pay ................. = " << iovertime_extra + (40*iwage) << endl;
} // End of the primary if statement

} //End of Int Main


It says that it builds successfully but after I enter in "hourly wage" the command window closes and the output says:

'Week2CP.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'Week2CP.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'Week2CP.exe': Loaded 'C:\Program Files\AVAST Software\Avast\snxhk.dll', Cannot find or open the PDB file
'Week2CP.exe': Loaded 'C:\WINDOWS\system32\msvcp100d.dll', Symbols loaded.
'Week2CP.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.
The program '[1076] Week2CP.exe: Native' has exited with code 0 (0x0).



WHAT AM I DOING WRONG??!!??
It compiles fine use GCC command line. Your logic is broken but I suppose that's the least of your worries.


Try running VS as administrator.
Find a way to keep the console open, so that you can read the last lines. And don't pay attention to that error messages, they always occur, even if the program runs fine.
Don't get me started on the logic... we were given a template and just told to adjust it so that it compiles.

I am SUPER new at this so I don't know what "GCC command line" is
Topic archived. No new replies allowed.