Hello there,
Here is a program that I wrote in Visual Studio 2005:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Programmer: Nathan D. Brown
//Date: 3-1-07
//This is exercise 2.19 from the Deitel book.
#include<iostream>
using std::cin;
using std::cout;
using std::endl;
int main()
{
double hworked;
double hrate;
double salary;
cout<<"Please enter hours worked ( -1 to exit):";
cin>>hworked;
if(hworked == -1){
cout<<"No records were processed.";
}
else{
while(hworked != -1){
cout<<"Please enter hourly rate:";
cin>>hrate;
if(hworked 40){
salary = (hworked - 40) * (hrate * 1.5) + (hworked - (hworked - 40)) * hrate;
}
else
salary = hworked * hrate;
cout<<"Employee salary is "<<salary<<endl;
cout<<"Please enter hours worked ( -1 to exit):";
cin>>hworked;
}
}
return 0;
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you could please give me some feedback on my programming style, I would appreciate it.
Thank you,
Nathan ;)
--
--------------------------------- --- -- -
Posted with NewsLeecher v3.9 Beta 1
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -