Ok, the teacher gave us a out-of-book program to write. Now she says that the program is doing the intention, but that she found "about 15 lines that can be done in a better manner". Now i'm sure there are 15, but based on what we have learned in class (because i can't apply things she hasn't taught for in-class work) i cannot rlly find anything. Could you please review/run my code and tell me what you may have done different? The only thing i truely hate is how i managed the deductions of the constants in the find_net function.

/* Edit: The iomanip is included because i plan to add a setiosflags line to format output. Thats not required so don't count that as an error*/

Code:
```/*	Steven Billington
December 20, 2002
NatPine.cpp

Program finds netpay for employees.
*/

#include "stdafx.h"
#include <iostream.h>
#include <iomanip.h>

/*	Prototype functions*/
double find_gross(double &worked, double &rate);
double find_net(double &grosspay);

/*	Const for deductions*/
const double FED_TAX = 0.18;
const double S_TAX = 0.045;
const double HOSP = 26.65;
const double UNION = 7.85;

int main(int argc, char* argv[])
{
/*	Input/function calls*/
double hours,
hr_rate,
gross,
net_pay;

/*	Prompt user*/
cout<<"Enter hours: ";
cin>>hours;
cout<<"Enter rate: ";
cin>>hr_rate;

/*	Call function*/
gross = find_gross(hours,hr_rate);

cout<<"\nGross hours worked: "<<"\t"
<<gross<<endl;

/*	Call function, output return*/
cout<<"\nNet pay is: "<<"\t\t"
<<find_net(gross)<<endl;

return 0;
}

/*	Function definition*/
/*	Function finds gross pay based on user
given values*/
double find_gross(double &worked, double &rate)
{
double gross_pay;

gross_pay = worked * rate;

return gross_pay;
}

/*	Function Declaration*/
/*	Function finds net pay based on return
of find_gross function by making
deductions*/
double find_net(double &grosspay)
{
double net_is,
percent_loss;

percent_loss = grosspay * FED_TAX;
grosspay -= percent_loss;
percent_loss = grosspay * S_TAX;
grosspay -= percent_loss;
grosspay -= HOSP;
grosspay -= UNION;

net_is = grosspay;

return net_is;
}```

2. I compiled your code, and you're not using the net_pay variable
in 'main'. I also changed your find net function a little. This may or may not be better, just a thought

Code:
```double find_net(double &grosspay)
{
double net_is,
percent_loss;

percent_loss = (grosspay * FED_TAX) + (grosspay * S_TAX);

net_is = grosspay - (percent_loss + HOSP + UNION);

return net_is;
}```
I didn't test it to see if it works, but my basic thoughts are, fewer lines (although I usually like more but simpler lines), and this way 'grosspay' isn't changed. Just some ideas.

3. You could rewrite find_gross as an inline function.

4. >Personally, I'd go with clarity before deciding to make it an IOCCC entry for the sake of a few lines.
What fun is that?
Code:
```/*
NatPine.cpp:

Creation (2002,12,20) Steven Billington
Edit (2002,12,21) JSW

Program finds netpay for employees.
*/
#include <iostream>

double find_gross(double worked, double rate);
double find_net(double grosspay);

// Gross dependent deductions (percentage)
const double FED_TAX = 0.18;
const double S_TAX   = 0.045;
// Gross independent deductions
const double HOSP    = 26.65;
const double UNION   = 7.85;

int main()
{
double hours, hr_rate, gross;

std::cout<<"Enter hours worked and hourly rate: ";
std::cin>> hours >> hr_rate;

gross = find_gross(hours, hr_rate);

std::cout<<"\nGross pay:\t"<< gross;
std::cout<<"\nNet pay:  \t"<< find_net(gross) <<std::endl;
}

double find_gross(double worked, double rate)
{
return worked * rate;
}

double find_net(double grosspay)
{
return grosspay - ((grosspay * FED_TAX) + (grosspay * S_TAX) + HOSP + UNION);
}```
-Prelude

5. thnx guys, that helps alot.