Jiskha Homework Help
SATURDAY
November 21, 2009
SCHOOL SUBJECTS
- Art
- Business
- Computers
- English
- Foreign Languages
- Health
- Home Economics
- Math
- Music
- Physical Education
- Science
- Social Studies
GRADE LEVELS
- Preschool
- Kindergarten
- Elementary School
- 1st Grade
- 2nd Grade
- 3rd Grade
- 4th Grade
- 5th Grade
- 6th Grade
- 7th Grade
- 8th Grade
- High School
- 9th Grade
- 10th Grade
- 11th Grade
- 12th Grade
- College
- Adult Education
Post a New Question | Current Questions | Chat With Live Tutors

Homework Help Forum: Computer Science - Java

Posted by Lisa on Monday, October 26, 2009 at 4:15pm.

Hi,

For an assignment I am doing, we have to have 2 service classes and one application class. One service class is already written (i.e. DiceGame1) and I am writing another one (i.e. Player) that is supposed to use the previous service class an instance variable. I was just wondering how I would do that?

  • Computer Science - Java - MathMate, Monday, October 26, 2009 at 5:36pm

    A service class emulates the actual operation of the service you are trying to provide.
    For a player, you would think of what he needs to do, for example:
    initialize player (name, credit card number, etc.)
    choose preferences (type of game, throw first or second, etc.)
    start a game
    decide on amount of bet
    throw dice
    keep score/winnings
    quit game

    So you will need to provide methods for all these and probably other activities, including other private methods that are required to provide information to the public methods (get/set methods, etc.)

    Depending on what services you will need, you will establish the state variables, which are usually private.

    Hope this gets you started, and post if you have comments or questions.

Answer this Question

First Name:
School Subject:
Answer:

For Further Reading

SEARCH

COMMUNITY
FEATURES
- Live Tutors
- Net Riddle
- Reference
- Search