Computer Science 202
Introduction to Programming
Fall 2013, The College of Saint Rose
Agenda
We looked at the "JOptionPane" mechanism for reading input to and displaying output from programs using pop-up dialog boxes during our last regular class meeting, but didn't have much chance to practice with them.
Consider this new, slightly more complex example, of a Java application that prompts for and reads in some information from the terminal window with a Scanner and which reports its results to the terminal window:
Convert this example to use the JOptionPane methods for input and output. Use the NoInterestLoan example for guidance. Note that you should use a separate JOptionPane.showInputDialog for each item you wish to read in. Thus, your program will have 4 prompts instead of the 2 in the original Scanner-based version. We will see later how you can parse multiple inputs from a single input dialog, but for now you should just use separate dialogs.
Please submit only the file RunsScored.java in Submission Box under "InClass13" before you leave class.
Due at the start of class, Thursday, October 17.
Please submit answers to these questions in Submission Box under "LA13" by the start of our next class. We will discuss these questions at the start of class, so no late submissions are accepted. Please be sure that your name is clearly indicated in all submissions.
Examples