Course web page: Introduction to Computer Science for non-majors II James Tam | Return to the course web page |
Due Tuesday March 31
Create a simple calculator that will multiply two numbers. When the program first starts it will display a container and a button 'multiply' (Figure 1). You can configure the layout however you wish but it must show all the required controls and it must also be presented in a way that is easy to understand/interpret (no garbled messages or messed up display of GUI components).
Figure 1: Main window |
When the user clicks on the button prompts will appear in the console command line for the two numbers to be multiplied (Figure 2). If the user clicks on the close window control then the program will end (the window will not just disappear).
Figure 2: prompts are text-based |
The resulting product will appear back in the GUI in the form of label (Figure 3).
Figure 3: The result is displayed using a graphical label |
Note that the mixing of console input and graphical output is not the usual approach taken in actual software. This approach was chosen to determine if students truly understand the event model well enough to apply the concepts in a way that is almost certainly different from both the examples provided in class and anything that may be found online or elsewhere (no "ready to download" solutions). This means that deviations in the assignment specifications will result in lesser credit (or perhaps no credit) being awarded.
Note: in order to receive credit the correct graphical controls must be used (e.g., a 'JDialog' could not be used in place of a 'JFrame')
Marks earned | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Grade point | 4.0 | 3.7 | 3.5 | 3.3 | 3.1 | 2.9 | 2.7 | 2.5 | 2.3 | 2.1 | 1.9 | 1.7 | 1.5 | 1.3 | 1.0 | 0.0 |