Descriptions class assignment

From WLCS
Revision as of 11:29, 5 May 2010 by Admin (talk | contribs)

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

Directions

  1. Download
  2. 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.