Difference between revisions of "Descriptions class assignment"
From WLCS
(New page: == Objective == == Purpose == == Directions ==) |
|||
| Line 1: | Line 1: | ||
== Objective == | == Objective == | ||
| + | * You will learn to create a class comprised of variables and methods | ||
| + | * You will learn to create arrays | ||
| + | * You will learn to access arrays | ||
== Purpose == | == Purpose == | ||
| + | * The Descriptions class will allow us to generate a random adjective to describe a room ("dark", "haunted", etc.) and a random room type ("living room", "parlor", etc.), as well as random weapon names ("katana", "sai", etc.) and monster names ("goblin", "troll", etc.). | ||
| + | |||
| + | == Resources == | ||
| + | * Introduction to Arrays - [[Media:IntroArrays.ppt]] | ||
| + | * [[Java Arrays Assignment]] | ||
== Directions == | == Directions == | ||
| + | # Download | ||
| + | # Examine the code in [[Media:Descriptions.java]]. | ||
| + | #* There are two arrays: the first is the list of adjectives, and the second is the list of room types. | ||
| + | #* The third instance variable is a Random object, used to create random numbers. | ||
| + | #* The default constructor is there, but does not need to do anything. | ||
| + | #* The other two methods (getNextAdjective() and getNextRoomType()) '''require completion''' for this part of the lab. | ||
Revision as of 10:29, 5 May 2010
Contents
Objective
- You will learn to create a class comprised of variables and methods
- You will learn to create arrays
- You will learn to access arrays
Purpose
- The Descriptions class will allow us to generate a random adjective to describe a room ("dark", "haunted", etc.) and a random room type ("living room", "parlor", etc.), as well as random weapon names ("katana", "sai", etc.) and monster names ("goblin", "troll", etc.).
Resources
- Introduction to Arrays - Media:IntroArrays.ppt
- Java Arrays Assignment
Directions
- Download
- Examine the code in Media:Descriptions.java.
- There are two arrays: the first is the list of adjectives, and the second is the list of room types.
- The third instance variable is a Random object, used to create random numbers.
- The default constructor is there, but does not need to do anything.
- The other two methods (getNextAdjective() and getNextRoomType()) require completion for this part of the lab.