Lab2 - Part One

Wednesday, June 18, 2008

//*****************************************************************************************************************************
//
// Match.java Author: [name] Date: [date]
//
// Purpose: store basic information about a match (for matching game, lab 2)
//*****************************************************************************************************************************

public class Match
{
//variable declarations
private String fileName; //filename of match object
private String choice1, choice2, choice3, choice4; //mutiple choice possibilities
private String answer; //correct description of match object (complete)

/* (complete)
* Constructor intializes values to the given values
* -file is the filename of the picture for the match
* -the 4 options are the 4 possible choices for the match
* -correctOption is the answer to the match
*/
public Match(String file, String option1, String option2, String option3, String option4, String correctOption)
{
fileName = file;
choice1 = option1;
choice2 = option2;
choice3 = option3;
choice4 = option4;
answer = correctOption;
}

/* (complete)
* Return filename of the picture of the match
*/
public String getFileName()
{
return fileName;
}

/*
* Return 1st choice of the match
*/
public String getChoiceOne()
{
return choice1;
}

/*
* Return 2nd choice of the match
*/
public String getChoiceTwo()
{
return choice2;
}

/*
* Return 3rd choice of the match
*/
public String getChoiceThree()
{
return choice3;
}

/*
* Return 4th choice of the match
*/
public String getChoiceFour()
{
return choice4;
}

/* (complete)
* Return answer of the match
*/
public String getAnswer()
{
return answer;
}
}

0 comments: