public class CulminatingJeopardy2 {
static String[][] questions = //Here is the list of questions used for the jeopardy game
{
{"He became Famous through youtube and was the artist who sang the song “baby”",
"I’ll Make Man Out of You was a song in which 1998 Disney animation?",
"Who is the most Famous White Rapper, also known as Slim Shady?",
"Who is the Artist of these songs? Love story, you belong with me.",
"Famous Canadian Rapper who “Started from the Bottom” ",},
{"We live on this planet ",
"Which planet is often referred to as “the red planet”? ",
"Which planet is the farthest from the sun? ",
"Which planet has a great red spot? ",
"Which planet has the most rings? "},
{"A way of virtually sending letters back and forth through cyberspace.",
"On this popular website YOU can upload and watch videos. ",
"On what popular program do we use to write documents? ",
"You should never give this to strangers in chat rooms.",
"In what year was the internet created? "},
{"The main characters in this book are Opal and her dog ",
"In this series, a group of four crime solving children live in a part of a train",
"The narrator in this book frequently speaks about saving the children from adulthood ",
"In this novel, Scout and her brother Jem live in the fictional town of Maycomb. ",
"One of Dr. Suess’s classics, this book involves a cartoon feline who terrorises when the parents are out "},
{"Who is the current president?",
"Who was the first president?",
"Who was the president during the Civil War?",
"Which president was involved in the Watergate Scandal?",
"Which president was so large that he frequently got stuck in his bathtub?"},
{"What sport consists of paddles, a smallball, and a table with a net?",
"An arcade game consisting of a yellow character and ghosts in a maze.",
"Athlete who won 8 medals in the olympics for swimming","Kobe Bryant is in which nba team?",
"What sport is Tiger Woods known for?"}};
static String[][] answers = // Here is the list of answers for the jeopardy game
{{"JUSTIN BIEBER", "MULAN", "EMINEM", "TAYLOR SWIFT", "DRAKE"},
{"EARTH", "MARS", "PLUTO", "JUPITER", "SATURN"},
{"E-MAIL","YOUTUBE", "MICROSOFT WORD", "PERSONAL INFORMATION", "1969"},
{"WINN DIXIE", "BOX CAR CHILDREN", "CATCHER AND THE RYE", "TO KILL A MOCKINGBIRD", "CAT IN THE HAT"},
{"BARACK OBAMA","GEORGE WASHINGTON","ABRAHAM LINCOLN","RICHARD NIXON", "WILLIAM TAFT"},
{"TABLE TENNIS","PACMAN","MICHAEL PHELPS", "LAKERS","GOLF"}};
static int[][] points = {{100,200,300,400,500},{100,200,300,400,500},{100,200,300,400,500},{100,200,300,400,500},{100,200,300,400,500},{100,200,300,400,500}};
static int score = 0;
static boolean[][] state = {{false,false,false,false,false},{false,false,false,false,false},{false,false,false,false,false},{false,false,false,false,false},{false,false,false,false,false},{false,false,false,false,false}};
public static void rungame ()
{
int choice1,choice2;
System.out.println(" ");
while(true)
{
System.out.println("Please select your category: [1] Music, [2] Space [3] Internet, [4] Name that book, [5] Presidents, [6] Games and Hobbies");
choice1 = In.getInt();
if(choice1 < 1 || choice1 > 6)
{
System.out.println("Not a valid category, please pick again");
rungame(); }
else
{
System.out.println("Please select your value: [1] $100, [2] $200, [3] $300, [4] $400, [5] $500" );
choice2 = In.getInt();
if(choice2 < 1 || choice2 > 5)
{
System.out.println("Not a valid value, please pick again") ;
rungame();
}
else
{
if (!state[choice1-1][choice2-1])
questions(choice1,choice2);
else
System.out.println("This category has already been selected, please pick again");
}
}
}
}
public static void questions(int choice1,int choice2)
{
System.out.println(questions[choice1-1][choice2-1]);
String answer = In.getString();
if (answer.toUpperCase() == answers[choice1-1][choice2-1]){
System.out.println("Congrats, you are correct!");
score = score + points[choice1-1][choice2-1];
System.out.println(score);
}
else
System.out.println("Sorry, you got the wrong answer");
state[choice1-1][choice2-1] = true;
score = score - points[choice1-1][choice2-1];
}
public static void startup ()
{
System.out.println("Welcome to Jeopardy!");
System.out.println("Rules [1]");
System.out.println("Start Game [2]");
System.out.println("Quit [3]");
System.out.println(" ");
System.out.println(" Press [1] , [2] , or [3]");
int x = In.getInt();
if (x == 1)
{
System.out.println("These are the rules of the game: When prompted you will enter your category");
System.out.println("number which is the column number(1,2,3,4,5,6) followed by the row number(1,2,3,4,5)");
System.out.println("You will answer the question and press enter accordingly ");
System.out.println("Go back to home screen? [1] = yes [anything else] = no");
int y = In.getInt();
if ( y == 1)
{
startup();
}
else
{
System.exit(0);
}
}
else if (x == 2)
{
rungame();
}
else
{
System.exit(0);
}
}
public static void main(String[] args)
{
startup();
}
}