User Interface Use cases for Homework 4 Normally we try to write "UI-free" use cases; that is, ones that don't mention the user interface. See the ones in use-cases.txt for examples like that. However the point of the use cases below is to explain how the user-interface to the calculator might work. So in the following we'll be mentioning the user interface parts in detail. This is perhaps reasonable as a way to do user interface design, although it's quite verbose and pictures might be better. Store a number in a register (UI version) Main success scenario: The user places the mouse cursor in the text box for a register in the "Registers" section of the UI, and types in a number (which is shown in the textbox); the user presses the enter key. The system remembers that the number is in the register whose name appears to the left of the text box. Alternative scenarios: If the user does not press the enter key, but instead moves the mouse focus away from the textbox previously selected, then the system remembers that the number is in the register whose name appears to the left of the text box. Store a formula in a subroutine (UI version) Main success scenario: In the "Formula Composition" section of the UI, the user selects register r3 underneath the label "First Register" by clicking the mouse on the little inverted triangle to the right of the box under the label "First Register" (in response to which the system presents a list of all the registers in the order r0, r1, ..., r9) and then placing the mouse cursor over the text "r3" that appears in the list and clicking on that. The system records that the first register is r3, and shows r3 in the box under "First Register". The user then selects register r7 underneath the label "Second Register" in the same way, and the system remembers that the second register is r7 and shows that in the box under "Second Register" The user selects - as the operator by clicking the mouse on the little inverted triangle to the right of the box under the label "Operator" (in response to which the system presents a list of all the operators in the order +, -, *) and then places the mouse cursor over the text "-" that appears in the list and clicking on that. The system remembers that the operator is - and displays that in the box on the left under the label "Operator". The user places the mouse cursor in the text box to the right of the label "Name" section of the UI, and types in the formula name "diff37" (which is shown in the textbox). The user then presses the Save button in the bottom right, and the system remembers the that the given name is associated with the formula that is the difference between registers r3 and r7 (respectively). Alternative scenarios: If the user presses the Reset button in the bottom right, then the selections and typing made so far in this section are discarded, and the combo box under "First Register" displays r0, the combo box under "Operator" displays "+", and the combo box under "Second Register" displays r0. If the user moves the mouse focus to another location after typing in the "Name" box, nothing happens. In particular, this is not the same as pressing either the Save or the Reset buttons. The user can make changes to selections or change the name in the box next to the label "Name" several times before pressing the Save or Reset buttons. Each time the system remembers the selection but does not make an association between the name and the formula until the user presses the "Save" button. Evaluate a formula (UI version) Main success scenario: In the "Named Formulas" section of the UI, the user selects the formula named "diff37" by clicking the mouse on the little inverted triangle to the right of the box under the label "Named Formulas" (in response to which the system presents a list of all the named formulas that it currently knows about) and then placing the mouse cursor over the text "diff37" that appears in the list and clicking on that. The system displays the name "diff37" in the box (without the quotes), and also displays the formula's string representation (i.e., "r3 - r7" without the quotes) in the box to the right of the triangle and to the left of the button labeled "Eval". The user then clicks the mouse on the Eval button, and the system responds by changing the main text box (at the top of the calculator, just underneath the label "Formula-Register Calculator" to display the value of the formula (in this case, the contents of the third register minus the contents of the seventh register). Alternative scenarios: If the user doesn't click on the Eval button, nothing happens to change the main text box.