InClassExercise04

InClassExercise04 - CS112 In-class Exercise 4 1 If not...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS112: In-class Exercise 4 1. If not already done, copy the naive-ticket-machine project from chapter02 , from the usual location, to your desktop (or other organized location). Start up BlueJ, and open the naive-ticket-machine project. Do Exercises… Chapter 2: 24, 25, 29, 30, 31, 32. Write your responses to a Word document. 2. Close the previous project, and make a New Project . Navigate up to the desktop and give the new project a name of rolling-dice. 3. Click on New Class . Give the new class the name of Die . 4. This new class will make objects that each simulates one six-sided die. Now edit the source file so we have the following basic functionality of a six-sided die. 5. Fields: Just one field for now, namely an integer variable that stores the current die value. So call it value . Make the appropriate edit in the source file. Now compile and make a new instance and inspect to see if your field is there. 6.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online