I need help with creating a program that allows the user to enter a payroll code. The program should search 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.
It's easier for us to help you if you:
1) Supply your code wrapped in code tags. This is the button on the right that looks like <>. Highlight your code and press that, or put [code] at the start of your code and [/code] at the end of it.
2) Supply us with any errors you're encountering. If you supply your complete code along with any compiler errors, it's easier for us to locate the line in question, evaluate it, and help you correct the issues.
3) Supply us with the desired output and your output. Obviously if we can see there is a difference between the two, we can help isolate the problem and help you correct it.
4) Supply us with specific lines of code that you feel are causing problems in your code. We like things to be simple, so the less code we have to sift through just to find something like you're missing a semicolon or you're doing an assignment instead of a comparison, it helps us provide quicker service.
We're not lazy, and a lot of us will go above and beyond to help someone. We're all coders after all and we like to see each other succeed. But we can't all afford to spend several hours on a simple program unless we're really bored. There are plenty of new members, and old ones, that need help and the ones that make it the easiest for us tend to get the quickest replies and in turn, quicker solutions to their problems.
int main(){
int numbers[100];
long integers[100];
int i = 0;
ifstream inFile;
inFile.open("Intermediate24.txt");
if( inFile.fail() )
cout << "Fail to open file ! " << endl;
if( inFile.is_open() ){
while( !inFile.eof() ){
inFile >> number[i];
inFile.ignore( 1,'#' );
inFile >> integers[i];
inFile.ignore(1,'\n');
i++;
}
}
//...Do your output staff . i only teach how to store to the array Basic concept
system( "pause" );
return 0;
}