Campbell Ritchie wrote:All the programs shown so far have been very incorrect, because they try to do everything in the main method. Cut your main method down to the two lines Winston suggests, and everything else goes elsewhere. If you had used object‑oriented programming (which nobody has even got anywhere near), you would have a much simpler program.
Pankaja Shinde wrote:Following is a correct program. . . .