Hi, please see below for my method code.
Every time the program runs, user enter bids for Work1 and the bids are passed into the function below and through the function, the highest bid is selected and displayed out.
But the problem is if user continue and enter bids for Work2 and the process goes round again. This time, Work2 highest bid will replace Work1 highest bid and display out. In my txt file, only Work2 highest bid is displayed.
What can I do so that both Work1 & Work2 highest bids are stored and displayed?
Please help, Thank you.
Of course there is. You obviously want on some calls to start from scratch and on others to append. The caller, who should know, must pass that info to the function.
You could pass the filename too, because now you will always write to same file and the only way for the user to change the name is to obtain the sources, edit, and recompile.