| |
Lab 19: Swapper II
Page history
last edited
by Mr. Kretsch 2 months, 3 weeks ago
Name: ________________________________
Objective: Functions
Instructions
- Open your swapper project
- Add to the form two labels and one button
- Add to the code:
- A function called isValid
- The function takes one parameter, a string
- The function returns a boolean: true if the string is an integer between 1 and 20; false otherwise
- A function called power
- The function takes two strings.
- The function returns the first string raised to the power of the second.
- When the user clicks the new button:
- Use the isValid to check that all four text boxes are valid
- If text boxes 1 and 2 are valid, copy in to the first label text box 1 raised to the power of text box 2
- If text boxes 3 and 4 are valid, copy into the second label text box 3 raised to the power of text box 4
Extra Credit
- Pop up a message box if the string is no valid. Make sure the message is specific
Grading
| Feature |
Points |
Out of |
Note |
| Form features |
|
1 |
|
| The isValid function |
|
4 |
|
| The power function |
|
2 |
|
| The third button click |
|
5 |
|
| Extra |
|
4 |
|
| Total |
|
12 |
|
Notes
Lab 19: Swapper II
|
|
Tip: To turn text into a link, highlight the text, then click on a page or file from the list above.
|
|
|
Comments (0)
You don't have permission to comment on this page.