PDA

View Full Version : C help!!



Mini_me
10-13-2004, 02:40 PM
Hi any ideas how i can write this code? :

"A company is paying its employees apart from the basic salary,two allowances,a family
allowance and a timeallowance.
The family allowance is 30 euros per child,the timeallowance is 45 euros per three years."
I want the program to read the employee's basic salary,the number of his/her children,the

years of his/her previous employment and finally to print his/her total salary rounded to
the smallest integer number.

I use the sstream library and i would like this program to use the most simple C code.

Thank you so much!!

scatcat
10-14-2004, 05:12 AM
Hi Mini_me

This sounds like a bit of home work to me ;-)

You have described what the program needs to do perfectly. That is often the hardest part.

From there you just need to turn it into code.

I think the best thing you could do, would be to try and write the code and test it.

If it still does not work come back, with the code, for some help.

The best way to really learn anything is to try, make mistakes and learn from those mistakes. This way you not only learn you also gain a deeper understanding of what you are supposed to be learning.

If someone here where to write the program for you, you would learn nothing, you would just have a bunch of working code that you may not even understand.

Kind Regards.

paulhiles
10-14-2004, 07:01 AM
Hi Mini_me, I go along with the comments scatcat made above. You're not going to learn anything by having someone else come along and magick up some code for you.

I've a sneaking suspicion this could be your homework or latest assignment we're seeing here too! :o)

Paul