Rohan G Jeopardy Trivia Class
Start of N@TM Final Jeopardy Class
import java.util.Dictionary;
import java.util.Hashtable;
public class Jeopardy {
public static void main(String[] args) {
int score = 0;
int total = 0;
int count = 0;
int correct = 0;
int Score;
Dictionary Jeopardy = new Hashtable();
// put() method
Jeopardy.put("What is the capital of Chile?", "Santiago");
Jeopardy.put("Who is Rohan Gaikwad's Favorite Artist", "Taylor Swift");
//print out Hashtable out
System.out.println(Jeopardy);
//Is there a record with the "Johnny Walker" key?
System.out.println(((Hashtable) Jeopardy).containsKey("Who is Rohan Gaikwad's Favorite Artist"));
//all keys of the Hashtable
System.out.println(((Hashtable) Jeopardy).keySet());
//values from Hashtable
System.out.println(((Hashtable) Jeopardy).values());
//the quantity of records
System.out.println(Jeopardy.size());
//removing one record
System.out.println(Jeopardy);
System.out.println(score);
System.out.println(total);
System.out.println(count);
System.out.println(correct);
System.out.println(score + 10);
Score = score + 10;
System.out.println(Score);
// private void CheckAnswer() {
// if this.value() = this.guess() {
// int score = score + 1;
// }
// }
}
}
Jeopardy.main(null)