
MAT 2170 — Methods Worksheet — Spring 09
For each of the following method descriptions, give the most appropriate method header.
1. Determines whether two characters are consecutive alphabetically
2. Breaks a string into “words” and displays these words so that no more than 50 characters are
displayed on each line of output (if possible)
3. Creating a movingCircle object with random speed and displacement (similar to the
createFilledCircle method), given the initial location, size and color desired.
4. Calculates xygiven the integers xand y
5. Determines the number of digits in a positive integer
6. Given a prompt, displays it then determines whether the user entered “yes” or “no”
7. Reports the result of rolling a die
8. Reports the result of rolling a pair of dice
9. Given a numeric version of the date (day, month, and year), return a string version consisting of
the day, a hyphen, the first three letters of the corresponding month, and the last 2 digits of the
year.
10. Determines whether a character is an English consonant