Guest User

Untitled

a guest
Nov 17th, 2013
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. Goal, Description and Submission Instructions
  2. The goal of this project is to become more familiar with creating and using classes and objects in Java, to further
  3. introduce you to the concepts of abstraction and modularization, and to directly use collections of items.
  4.  
  5. Instructions
  6. Create a new Java project named “Project1_netid” (where you replace netid with your NetID). Be sure to
  7. include the Text and ListSpinner classes posted on Blackboard, in the Course Materials section. (They
  8. are in the project WheelTemplate). DO NOT MODIFY THESE TWO CLASS FILES IN ANY WAY.
  9.  
  10. 1. Create a Puzzle class in preparation for the next Project, that has the following components:
  11. a. A field for the Puzzle’s category (thing, place, etc.) and a field for the phrase to be guessed
  12. b. Create a constructor that takes a category and phrase as input. *Make sure you convert the values supplied
  13. to the parameters to be all uppercase letters.
  14. c. Write get and set methods for both fields.
  15. d. Write a toString method that prints out the phrase followed by category in parentheses.
  16. e. Create a main method to test the class by creating a Puzzle and printing it out by calling toString().
  17.  
  18. 2. Create a RandomString class (starting from the template on Blackboard) and implement the following:
  19. a. Create a file named wheel_values.txt in the Project1_netid project that contains dollar amounts for the
  20. values in your wheel spinner. Some valid values include 600 or $3,000. This file will have one value per
  21. line. Make sure this file is in the topmost project folder, not inside your src folder (i.e., it should show up
  22. below the JRE System Library).
  23. b. A constructor that receives the name of a file to get string values from. The constructor should read in the
  24. phrases from the file and store them for later use using a private loadStringsFromFile method.
  25. c. next – a method that returns a random string value from the file; this value shouldn’t be repeated until
  26. all guess phrases in the file have been used.
  27. d. shuffle
  28. e. Create a main method to test that next is working correctly by repeatedly calling next & printing the result
  29. – you should not have any repeats, and the phrases should not be in the same order as in the file.
  30. f. Once you’ve verified your RandomString class is working by testing it in main, run the
  31. ListSpinner class to verify your wheel will spin properly.
  32.  
  33. 3. Be sure to:
  34. a. Use proper indentation
  35. b. Use appropriate variable/field names
  36. c. Group like things together (items that are part of the same objects)
  37. d. Use appropriate comments – including comments for each method
  38. e. Check your curly braces
  39.  
  40. 4. For this project you will submit the following (see “Saving and Submitting your Work” for details):
  41. a. A general archive file (e.g. a zip)
  42. b. A runnable JAR file
  43. c. At least one JPG showing your application
Advertisement
Add Comment
Please, Sign In to add comment