Write your question here.
I need help with an error that is preventing from compiling my code.
the error reads as:
error: 'Jon' was not declared in this scope.
Thank you kemourt. I got the program to compile correctly now but it does not read the inserted file correctly. The program is supposed to read another file with that read as:
1 2 3
Jon Doe
20
30
it is supposed to take these numbers and use them to output Jon Doe's income of that week based off his hours. For whatever reason it comes out as $0 for his earnings. Do I need to declare more strings?
I'm reasonably sure the line I wrote is correct. It's the same as your line 30 which I missed seeing. However line 30 is in the wrong place because the total_wage is being calculated before, not after which is the correct spot, you have read in the values.
Shifting lines 23-31 should work. Leave the other lines where they are - you'll see they both don't have to be shifted. Try it. Don't forget to use 'undo/redo' if necessary.
But you are right, the details have to be read in before the calculation is done. You are dealing with a machine not a mind reader. :)
That makes sense, I had gotten certain parts from my professor in a class and didn't even give thought to the order they should have been put in. Thanks for the help!