Create a game similar to Feud Family Feud. Build a game board that shows the que
ID: 3575559 • Letter: C
Question
Create a game similar to Feud Family Feud. Build a game board that shows the question that was asked of an audience. Have the user guess at a possible answer. Indicate whether the answer was correct by displaying the board with the answer revealed. Keep score of how many points the user has gained. Allow for two teams playing. The team with the most points after three rounds is the winner. Must be in java coding.
Rubric:
Gameplay is easy to understand from the display game board.
Survey Questions are displayed with number of possible answer and point value indicated.
Originality in layout of game board.
Round Total is updated when an answer is guessed.
Round Total is added to team total when round is won.
Two user teams is required for game play and computer is playing against the player
Host makes more than two comments during gameplay
Three rounds are played per game.
Teams can steal a point for the other team if they answer incorrectly.
Teams are switched after Three X's
Winning Team is announced
Explanation / Answer
public class Answer {
private String answer;
private int points;
public Answer() {
}
public Answer(String answer, int points) {
this.answer = answer;
this.points = points;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getAnswer() {
return answer;
}
public void setPoints(int points) {
this.points = points;
}
public int getPoints() {
return points;
}
@Override
public String toString() {
return String.format("%s %3d", answer, points);
}
}
If you want to keep some questions in the game then you can go to following one
public class Question() {
private String question;
private Answer[] answers;
public Question(String question, Answer[] answers) {
this.question = question;
this.answers = answers;
}
public Question() {
answers = new Answer[5];
}
public setQuestion(String question) {
this.question = question;
}
public String getQuestion() {
return question;
}
public void setAnswers(Answer[] answers) {
this.answers = answers;
}
public void setAnswer(int index, String answer, int points) {
if(index < answers.length) {
answers[index] = new Answer(answer, points);
}
}
public Answer[] getAnswers() {
return answers;
}
public Answer getAnswer(int index) {
if (index < answers.length) {
if (answers[index] != null) {
return answers[index];
}
else {
return null;
}
}
}
public String getAnswerStrings() {
StringBuilder sb = new StringBuilder();
for(Answer a : answers) {
sb.append(a.toString() + " ");
}
return sb.toString();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(question + " ");
sb.append(getAnswerStrings);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.