Question: i need java code From the textbook's exercises 4.21 and 4.23 make a driver class (needing only a main method) in a source code file


i need java code
From the textbook's exercises 4.21 and 4.23 make a driver class (needing only a main method) in a source code file named Largest.java (pp 146-7) except that it should allow an unlimited number of inputs other than zero (terminate input on 0). After all inputs have been entered, print out the largest two values found. Note that the two largest values might be duplicates (this case should be handled properly-don't ignore duplicates). To make testing easier, you might consider entering test cases into plain text files that can be processed in place of manual keyboard entry. To do so, place your input data (numbers) on sequential lines in your text editor and save the file with some name (i.e. testcase1). Then to test your solution with the test case, run you solution with the following command-line syntax: java Largest aa You will still see all the usual prompts and any other outputs you print to the console, but the input data will actually come from the test case file. Warning: Do NOT place the instantiation of your Scanner inside of your read loop! Doing so is anathema in computer science. You may not notice the problem when actually reading from the keyboard, but it will destroy the data stream from your input file. Standard input streams must work consistently, so never make this mistake. Here is a sample run (without using an input file) so please follow this output format exactly (though your data may vary from run to run) F Java Largest Enter nunbers, one per line, 0 on the last line to ena: 2000 200
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
