This set of labs should help you firm up your overview of object-oriented programming.
This lab set is worth (Level 4).
You can add (Level 1.5) by allowing your user to enter the size of the die they'd like rolled for P2.10. (Tip: for more on numeric data types and user input, see Chapter 4.)
You can add an additional (Level 1.5) by allowing your user to enter the size of the die in conventional gamer notation. (Note: When only one die is being rolled, the 1 before the d is optional. And you needn't worry about any of the extra notations beyond AdX...) (Side note: But I've seriously never seen those particular letters used for 'number of dice' and 'die size' before. I only remember NdS...which seems to make more sense...maybe there is a copyright issue with WotC..? *shrug*)
You can add (Level 3) by using an array to hold multiple Random integers for your program from P2.10 or P2.11. Be sure to display all of your Randomly selected integers for your user! This version can replace your original program. (Tip: for more on using arrays, see Chapter 7; specifically Section 1.)
If you are doing this for P2.10, you can combine it with the user input option above for additional levels...
You can add (Level 3) by disallowing repeated lottery combinations for your program from P2.11. This version can replace your current program. (Note: Although this option requires you to also do the previous option (with respect to P2.11, of course), their levels will stack.) (Tip: you'll need to look more closely at the decision making constructs from Chapter 5; specifically Sections 1 & 2.)
(Note: Sorting the lottery combinations is not required and not called for in the original description. Simply keep your array's elements unique by not allowing the duplicates in in the first place.) (This may seem like segregation, but let's not anthropomorphize quite that much. *grin*)
You can add (Level 1) by simply doing Programming Exercise P2.6.
You can add (Level 1) by simply doing Programming Exercise P2.8.
You can add (Level 1) by simply doing Programming Exercise P2.14.
You can add (Level 1.5) by simply doing Programming Exercise P2.15.
I'll add an additional (Level 1) if you work in the ideas from Programming Exercises P2.7 & P2.9 by making your display a table of three columns. The middle column should be as originally described and be titled Normals. The last column should display the color with "Bright " prepended in the color resulting from a brighter transform (as from P2.7) and be titled Brights. The first column should display the color with "Dark " prepended in the color resulting from a darker transform (as from P2.9) and be titled Darks.
You can add (Level 1) by simply doing Programming Exercise P2.16.
You can add (Level 1.5) by simply doing Programming Exercise P2.17.
You can add (Level 2) by simply doing Programming Exercise P2.18.
You can add (Level 1.5) by simply doing Programming Project 2.1.
You can add (Level 1.5) by simply doing Programming Project 2.2. The mentioned extra credit is worth its own (Level 1.5).
You can add another (Level 1.5) by allowing the user to enter their name and placing that in your greeting JTextField. (Hint: Recall what you learned in Chapter 1 ...er...in Programming Exercise P1.9?)