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?

2 answers

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.
Sammy and Andy wanted to measure their classroom. Would this work ? Why or why not
Similar Questions
  1. Programming AssignmentThis assignment will give you practice with defining classes. You are to write a set of classes that
    1. answers icon 1 answer
  2. Assignment Instruction & Background:For this assignment, you will be given the opportunity to meet as a group to discuss the
    1. answers icon 1 answer
  3. pythonImagine that you are creating a program that an online streaming service will use to manage its inventory of shows.
    1. answers icon 1 answer
  4. Creating a Public Service AdvertisementAssignment Information Purpose: Create a Public Service Advertisement (PSA) about an
    1. answers icon 1 answer
more similar questions