assistance with program

Hello,


i need help with creating a program that allows the user to enter a payroll code. The program should research for the payroll code in the file and then display the appropriate salary. If the payroll code is not in the file, the program should display an appropriate message. Use a sentinel value to end the program. Test the program using the following payroll codes: 10, 24, 55, 32, and 6. Stop the program by entering your sentinel value.


i will past the contents of the file.


1#27200
2#15000
3#23000
4#12000
5#25500
6#18400
7#19500
8#32000
9#29000
10#16500
20#65000
21#65500
22#70200
23#71000
24#71100
25#72000
30#83000
Last edited on
this string confuses me:

 
while (code < 0 && code < 11 && code > code && code < 26 && code < 33)


I suppose you are going to increase 'code' variable.
what's that (...code > code...)?
(...code < 11 && code < 26 && code < 33)- some rubbish.

Firstly learn to make up algorithms, then show your ideas.
This code is totally illiterate.
Igor1024 wrote:
Firstly learn to make up algorithms, then show your ideas.
This code is totally illiterate.

This was uncalled for.

@ade161: if a number is less than 0 it's guaranteed to be less than 11, 26, and 33 (and any number greater than or equal to 0). Also, as Igor1024 pointed rather unkindly, a number can't be greater than itself. You probably meant something else, but since you seem to have removed the original code, I can't tell what was going on.
Topic archived. No new replies allowed.