Instructions:
- Download the form for this project from the
website: Rainbow Calculator
- The form contains the objects shown above.
- For this project IGNORE all the blue command buttons
on the right. You will not be using them.
- The purpose of this project is to make a number appear
in the picture box at the bottom when you press a series of command
buttons in the KEYPAD area of the calculator. (The command buttons for
the digits 0-9, the MINUS and DOT). The form above shows the result
after pressing the "2", the "5", the "DOT",
the "1", and the "4" command buttons. 25.14 appears
in the picture box.
- The form already has a global variable, num_str,
declared as type string. (See the comments in the code part of the form
file.)
- Your job is to concatenate a digit (or minus
or dot) to the contents of the string variable each time one of the
12 keypad command buttons is pressed.
- In the case shown above the string variable starts
out with no characters.
- The user presses the "2" command button.
- The character "2" is concatenated onto
the value of the string variable:
Let num_str = num_str & cmdTwo.Caption
- The picture box is cleared.
- The string is printed to the picture box.
- The user presses the "5" command button.
- The character "5" is concatenated onto
the value of the string variable:
Let num_str = num_str & cmdFive.Caption
- The picture box is cleared.
- The string is printed to the picture box.
- And so on, each time a command button is pressed.
- The code is provided for the "0" command
button already, and empty subroutines alread exist for all the others.
You just need to fill in the code.
- Also provide code for the Clear command button that
clears the picture box and resets the string variable such that it contains
no characters.
- Add code to the end command button that will terminate
the program.
- Save your work to floppy disk.
- You may confer with classmates in working this problem.
|