>>// Lab 4 read and calculation file/input Ray Perales
>>// This program will read the data in the input file
>>// used by grosspayMinustaxFileCode
>>
>>#include <iostream>
>>#include <fstream>
>>using namespace std;
>>
>>int main()
>>
>{
>> ifstream fin;
>> fin.open("readgrosspayMinustax.in");
>> if (fin.fail())
>> {
>> cerr << "error opening input file.\n\n";
>> system("pause");
>> exit(1);
>> }
>>
int employee = 1;
>> int exemptions, taxbracket, inputValue;
>> double hours, payrate, overtime = 0.0, grosspay, netpay, rate, tax;
>>
>> // cout << "Enter an integer: "; //DO U NEED THE //
>> fin >> hours;
fin >> payrate;
>> while (cin >> hours)
>> { //DO I NEED TO INSERT HERE:
//COUT<<”ENTER YOUR PAYRATE: “;
//PAYRATE = NUMBER
>> if (hours > 40) //IF HOURS ARE GREATER THAN 40
>> overtime = hours - 40; //TAKE LETS SAY 43 – 40 AND ASSIGN TO OT
>> hours = 40; //HERE IT LOOKS LIKE IM TAKING 40 N ASGN TO HRS
>> //BECAUSE IT WILL ALWAYS BE 40? CAN BE LESS??
grosspay = hours * payrate + overtime * payrate * 1.5;
>> }
>> fin >> inputValue;
>> {
if (taxbracket == 1)
>> rate = .13;
>> else if (taxbracket == 2)
>> rate = .27;
>> else if (taxbracket == 3)
>> rate = .35;
>> }
>> fin >> inputValue;
>> {
>> tax = grosspay * (rate - .01 * exemptions); //WHERE R THE EXEMPTIONS
>> netpay = grosspay - tax; //COMING FROM??
>> }
>> cout << employee << hours << payrate << endl;
>> cout << taxbracket << exemptions << endl;
>> cout << grosspay << tax << netpay;
>>
>> fin.close();
>> system("pause");
>> return 0;
>>}