CS 10, Fall 2008
Assignment 2
Part 2 Runs


First run - user makes no mistakes:

> java ShowColorScale
Select First Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
8
Select Last Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
14
Enter amount of red (0 to 255): 0
Enter amount of green (0 to 255): 150
Enter amount of blue (0 to 255): 255
Enter number of levels >= 2: 15

Results:


Second run - user makes many mistakes:

> java ShowColorScale
Select First Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
25
no such choice: 25
Select First Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
14
Enter amount of red (0 to 255): cat
amount not int: cat
Enter amount of red (0 to 255): -5
amount out of range
Enter amount of red (0 to 255): 1.75
amount not int: 1.75
Enter amount of red (0 to 255): 0
Enter amount of green (0 to 255): 0
Enter amount of blue (0 to 255): 255
Select Last Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
apple
choice not int: apple
Select Last Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
1.5
choice not int: 1.5
Select Last Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
PINK
choice not int: PINK
Select Last Color by number:
  1: BLACK
  2: BLUE
  3: CYAN
  4: DARK_GRAY
  5: GRAY
  6: GREEN
  7: LIGHT_GRAY
  8: MAGENTA
  9: ORANGE
  10: PINK
  11: RED
  12: WHITE
  13: YELLOW
  14: Other
10
Enter number of levels >= 2: 1
entered < 2: 1
Enter number of levels >= 2: five
entered non-int: five
Enter number of levels >= 2: 5

Results: