Advertisement
Guest User

Halloween Com Sci

a guest
Oct 31st, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.60 KB | None | 0 0
  1. package me.harrisonfreni.ExtraCredit;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class halloween
  6. {
  7.     public static void main(String[] args)
  8.     {
  9.         // Pre-Init
  10.         Scanner input = new Scanner(System.in);
  11.  
  12.         // 1. Start Game
  13.  
  14.         game();
  15.  
  16.         // 7. Retry?
  17.         System.out.println("Would you like to try again? Y/N ");
  18.  
  19.         String retry = input.nextLine();
  20.  
  21.         while(retry.equalsIgnoreCase("Y"))
  22.         {
  23.             game();
  24.         }
  25.     }
  26.  
  27.     public static void game()
  28.     {
  29.         // Pre-Init
  30.         Scanner input = new Scanner(System.in);
  31.         int i  = 0;
  32.  
  33.         // 1. First Question
  34.         System.out.println("Which Candies Are Most Popular? ");
  35.         System.out.println("A. Kitkat");
  36.         System.out.println("B. Snickers");
  37.         System.out.println("C. Skittles");
  38.         System.out.println("D. Candy Corn");
  39.  
  40.         String q1In = input.nextLine();
  41.  
  42.         if(q1In.equalsIgnoreCase("A"))
  43.         {
  44.             System.out.println("You are wrong");
  45.         }
  46.         if(q1In.equalsIgnoreCase("B"))
  47.         {
  48.             System.out.println("You are wrong");
  49.         }
  50.         if(q1In.equalsIgnoreCase("C"))
  51.         {
  52.             System.out.println("You are wrong");
  53.         }
  54.         if(q1In.equalsIgnoreCase("D"))
  55.         {
  56.             System.out.println("You are correct");
  57.             i++;
  58.         }
  59.  
  60.         // 2. Second Question
  61.         System.out.println("Where does the moniker \"Halloween\" Come From? ");
  62.         System.out.println("A. The Jews");
  63.         System.out.println("B. The Catholics");
  64.         System.out.println("C. Buddhists");
  65.         System.out.println("D. Pastafarianism");
  66.  
  67.         String q2In = input.nextLine();
  68.  
  69.         if(q2In.equalsIgnoreCase("A"))
  70.         {
  71.             System.out.println("You are wrong");
  72.         }
  73.         if(q2In.equalsIgnoreCase("B"))
  74.         {
  75.             System.out.println("You are correct");
  76.             i++;
  77.         }
  78.         if(q2In.equalsIgnoreCase("C"))
  79.         {
  80.             System.out.println("You are wrong");
  81.         }
  82.         if(q2In.equalsIgnoreCase("D"))
  83.         {
  84.             System.out.println("You are wrong");
  85.         }
  86.         // 3. Third Question
  87.         System.out.println("What Was Candy Corn Known As?");
  88.         System.out.println("A. Corn Candy");
  89.         System.out.println("B. Chicken Feed");
  90.         System.out.println("C. The Beacons");
  91.         System.out.println("D. Buttercream Candies");
  92.  
  93.         String q3In = input.nextLine();
  94.  
  95.         if(q3In.equalsIgnoreCase("A"))
  96.         {
  97.             System.out.println("You are wrong");
  98.         }
  99.         if(q3In.equalsIgnoreCase("B"))
  100.         {
  101.             System.out.println("You are wrong");
  102.         }
  103.         if(q3In.equalsIgnoreCase("C"))
  104.         {
  105.             System.out.println("You are wrong");
  106.         }
  107.         if(q3In.equalsIgnoreCase("D"))
  108.         {
  109.             System.out.println("You are correct");
  110.             i++;
  111.         }
  112.         // 4. Fourth Question
  113.         System.out.println("How Rare is a Full Moon On Halloween");
  114.         System.out.println("A. Common");
  115.         System.out.println("B. Not That Rare");
  116.         System.out.println("C. Rare");
  117.         System.out.println("D. Extremely Rare");
  118.  
  119.         String q4In = input.nextLine();
  120.  
  121.         if(q4In.equalsIgnoreCase("A"))
  122.         {
  123.             System.out.println("You are wrong");
  124.         }
  125.         if(q4In.equalsIgnoreCase("B"))
  126.         {
  127.             System.out.println("You are wrong");
  128.         }
  129.         if(q4In.equalsIgnoreCase("C"))
  130.         {
  131.             System.out.println("You are wrong");
  132.         }
  133.         if(q4In.equalsIgnoreCase("D"))
  134.         {
  135.             System.out.println("You are correct");
  136.             i++;
  137.         }
  138.         // 5. Fifth Question
  139.         System.out.println("What was trick or treating re-popularized by?");
  140.         System.out.println("A. Pumpkin Spice");
  141.         System.out.println("B. Sports");
  142.         System.out.println("C. Cartoons");
  143.         System.out.println("D. The Dead");
  144.  
  145.         String q5In = input.nextLine();
  146.  
  147.         if(q5In.equalsIgnoreCase("A"))
  148.         {
  149.             System.out.println("You are wrong");
  150.         }
  151.         if(q5In.equalsIgnoreCase("B"))
  152.         {
  153.             System.out.println("You are wrong");
  154.         }
  155.         if(q5In.equalsIgnoreCase("C"))
  156.         {
  157.             System.out.println("You are correct");
  158.             i++;
  159.         }
  160.         if(q5In.equalsIgnoreCase("D"))
  161.         {
  162.             System.out.println("You are wrong");
  163.         }
  164.         // 6. println Score
  165.         System.out.println("Your score is: " + i);
  166.     }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement