Michitakaa2018

Mathgame.java

Jan 21st, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Mathgame {
  4.  public static void main(String args[]){
  5.      String s;
  6.      Scanner scan = new Scanner(System.in);
  7.      System.out.println("Welcome to Mathgame");
  8.      System.out.println("Enter your username");
  9.      s = scan.nextLine();
  10.      System.out.println("Welcome "+s);
  11.      System.out.println();
  12.      System.out.println("Ok, lets start the questions.");
  13.      System.out.println();
  14.      System.out.println("Level 1");
  15.      System.out.println();
  16.      System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  17.      System.out.println("|   What is  |");
  18.      System.out.println("|  23 − 11   |");
  19.      System.out.println("|      ?     |");
  20.      System.out.println("| _______|");
  21.      System.out.println(" A__A  || ");
  22.      System.out.println("(•ㅅ•) || ");
  23.      System.out.println("/   づ");
  24.      System.out.println("");
  25.      System.out.println("You have two chances to answer the questions.");
  26.      
  27.      Scanner www = new Scanner(System.in) ;
  28.      double c;
  29.      System.out.println("Enter the answer");
  30.      c = www.nextDouble() ;
  31.      if (c == 12) {
  32.      System.out.println("Well done!! It's right!");
  33.      } else  {
  34.           System.out.println("It's wrong");
  35.          
  36.           System.out.println("Try again");
  37.              c = www.nextDouble() ;
  38.              while (c == 1);
  39.              if (c == 12) {
  40.                  System.out.println("Well done!! you're right!");
  41.              }
  42.              
  43.  
  44.              else{ System.out.println("Try again");
  45.                  c = www.nextDouble() ;
  46.                  while (c == 1);
  47.                  if (c == 12) {
  48.                      System.out.println("Well done!! you're right!");
  49.                  }
  50.                  else{ System.out.println("You failed");
  51.                  }
  52.                  }
  53.                  
  54.      }           
  55.      
  56.      if (c == 12) {
  57.          System.out.println();
  58.          System.out.println("Level 2");
  59.          System.out.println();
  60.          System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  61.          System.out.println("|   What is  |");
  62.          System.out.println("|  123 − 12  |");
  63.          System.out.println("|      ?     |");
  64.          System.out.println("| _______|");
  65.          System.out.println(" A__A  || ");
  66.          System.out.println("(•ㅅ•) || ");
  67.          System.out.println("/   づ");
  68.          System.out.println("");
  69.          System.out.println("You have two chances to answer the questions.");
  70.          
  71.          System.out.println("Enter the answer");
  72.          c = www.nextDouble() ;
  73.          if (c == 111) {
  74.          System.out.println("Well done!! It's right!");
  75.          }
  76.          else  {
  77.               System.out.println("It's wrong");  
  78.              
  79.               System.out.println("Try again");
  80.             c = www.nextDouble() ;
  81.              while (c == 1);
  82.              if (c == 111) {
  83.                  System.out.println("Well done!! you're right!");
  84.              }
  85.              
  86.              else{ System.out.println("Try again");
  87.              c = www.nextDouble() ;
  88.              while (c == 1);
  89.              if (c == 111) {
  90.                  System.out.println("Well done!! you're right!");
  91.              }
  92.              else{ System.out.println("You failed");
  93.              }
  94.              }
  95.              }
  96.              
  97.      
  98.          }
  99.          
  100.          if (c == 111) {
  101.              System.out.println();
  102.              System.out.println("Level 3");
  103.              System.out.println();
  104.              System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  105.              System.out.println("|   What is  |");
  106.              System.out.println("|  4^3       |");
  107.              System.out.println("|      ?     |");
  108.              System.out.println("| _______|");
  109.              System.out.println(" A__A  || ");
  110.              System.out.println("(•ㅅ•) || ");
  111.              System.out.println("/   づ");
  112.              System.out.println("");
  113.              System.out.println("You have two chances to answer the questions.");
  114.  
  115.              System.out.println("Enter the answer");
  116.              c = www.nextDouble() ;
  117.              if (c == 64) {
  118.              System.out.println("Well done!! It's right!");
  119.              } else  {
  120.                   System.out.println("It's wrong0");  
  121.                  
  122.                   System.out.println("Try again");
  123.                  c = www.nextDouble() ;
  124.                  while (c == 1);
  125.                  if (c == 64) {
  126.                      System.out.println("Well done!! you're right!");
  127.                  }
  128.                  
  129.                  else{ System.out.println("Try again");
  130.                  c = www.nextDouble() ;
  131.                  while (c == 1);
  132.                  if (c == 64) {
  133.                      System.out.println("Well done!! you're right!");
  134.                  }
  135.                  else{ System.out.println("You failed");
  136.                  }
  137.                  }
  138.                  }
  139.                  
  140.          
  141.              }
  142.              if (c == 64) {
  143.                  System.out.println();
  144.                  System.out.println("Level 4");
  145.                  System.out.println();
  146.                  System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  147.                  System.out.println("|   What is  |");
  148.                  System.out.println("|  5^2-10    |");
  149.                  System.out.println("|      ?     |");
  150.                  System.out.println("| _______|");
  151.                  System.out.println(" A__A  || ");
  152.                  System.out.println("(•ㅅ•) || ");
  153.                  System.out.println("/   づ");
  154.                  System.out.println("");
  155.                  System.out.println("You have two chances to answer the questions.");
  156.                  
  157.                  System.out.println("Enter the answer");
  158.                  c = www.nextDouble() ;
  159.                  if (c == 15) {
  160.                  System.out.println("Well done!! It's right!");
  161.                  } else  {
  162.                       System.out.println("It's wrong");  
  163.                      
  164.                       System.out.println("Try again");
  165.                      c = www.nextDouble() ;
  166.                      while (c == 1);
  167.                      if (c == 15) {
  168.                          System.out.println("Well done!! you're right!");
  169.                      }
  170.                      
  171.                      else{ System.out.println("Try again");
  172.                      c = www.nextDouble() ;
  173.                      while (c == 1);
  174.                      if (c == 15) {
  175.                          System.out.println("Well done!! you're right!");
  176.                      }
  177.                      else{ System.out.println("You failed");
  178.                      }
  179.                      }
  180.                  }
  181.                      
  182.              
  183.                  }
  184.                  if (c == 15) {
  185.                      System.out.println();
  186.                      System.out.println("Level 5");
  187.                      System.out.println();
  188.                      System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  189.                      System.out.println("|   What is  |");
  190.                      System.out.println("|  2^3 − 11  |");
  191.                      System.out.println("|      ?     |");
  192.                      System.out.println("| _______|");
  193.                      System.out.println(" A__A  || ");
  194.                      System.out.println("(•ㅅ•) || ");
  195.                      System.out.println("/   づ");
  196.                      System.out.println("");
  197.                      System.out.println("You have two chances to answer the questions.");
  198.                      
  199.                      System.out.println("Enter the answer");
  200.                      c = www.nextDouble() ;
  201.                      if (c == -3) {
  202.                      System.out.println("Well done!! It's right!");
  203.                      } else  {
  204.                           System.out.println("It's wrong");  
  205.                          
  206.                           System.out.println("Try again");
  207.                          c = www.nextDouble() ;
  208.                          while (c == 1);
  209.                          if (c == -3) {
  210.                              System.out.println("Well done!! you're right!");
  211.                          }
  212.                          
  213.                          else{ System.out.println("Try again");
  214.                          c = www.nextDouble() ;
  215.                          while (c == 1);
  216.                          if (c == -3) {
  217.                              System.out.println("Well done!! you're right!");
  218.                          }
  219.                          else{ System.out.println("You failed");
  220.                          }
  221.                          }
  222.                          
  223.                  
  224.                      }
  225.                      if (c == -3) {
  226.                          System.out.println();
  227.                          System.out.println("Level 6");
  228.                          System.out.println();
  229.                          System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  230.                          System.out.println("|   What is  |");
  231.                          System.out.println("|  9*7  -63  |");
  232.                          System.out.println("|      ?     |");
  233.                          System.out.println("| _______|");
  234.                          System.out.println(" A__A  || ");
  235.                          System.out.println("(•ㅅ•) || ");
  236.                          System.out.println("/   づ");
  237.                          System.out.println("");
  238.                          System.out.println("You have two chances to answer the questions.");
  239.                          
  240.                          System.out.println("Enter the answer");
  241.                          c = www.nextDouble() ;
  242.                          if (c == 0) {
  243.                          System.out.println("Well done!! It's right!");
  244.                          } else  {
  245.                               System.out.println("It's wrong");  
  246.                              
  247.                               System.out.println("Try again");
  248.                              c = www.nextDouble() ;
  249.                              while (c == 1);
  250.                              if (c == 0) {
  251.                                  System.out.println("Well done!! you're right!");
  252.                              }
  253.                              
  254.                              else{ System.out.println("Try again");
  255.                              c = www.nextDouble() ;
  256.                              while (c == 1);
  257.                              if (c == 0) {
  258.                                  System.out.println("Well done!! you're right!");
  259.                              }
  260.                              else{ System.out.println("You failed");
  261.                              }
  262.                              }
  263.                              
  264.                          }
  265.                          if (c == 0) {
  266.                              System.out.println();
  267.                              System.out.println("Level 7");
  268.                              System.out.println();
  269.                              System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  270.                              System.out.println("|   Solve x  |");
  271.                              System.out.println("|  X^2-9=0   |");
  272.                              System.out.println("|      ?     |");
  273.                              System.out.println("| _______|");
  274.                              System.out.println(" A__A  || ");
  275.                              System.out.println("(•ㅅ•) || ");
  276.                              System.out.println("/   づ");
  277.                              System.out.println("");
  278.                              System.out.println("You have two chances to answer the questions.");
  279.  
  280.                              System.out.println("Enter the answer");
  281.                              c = www.nextDouble() ;
  282.                              if (c == 3) {
  283.                              System.out.println("Well done!! It's right!");
  284.                              } else  {
  285.                                   System.out.println("It's wrong");  
  286.                                  
  287.                                   System.out.println("Try again");
  288.                                  c = www.nextDouble() ;
  289.                                  while (c == 1);
  290.                                  if (c == 3) {
  291.                                      System.out.println("Well done!! you're right!");
  292.                                  }
  293.                                  
  294.                                  else{ System.out.println("Try again");
  295.                                  c = www.nextDouble() ;
  296.                                  while (c == 1);
  297.                                  if (c == 3) {
  298.                                      System.out.println("Well done!! you're right!");
  299.                                  }
  300.                                  else{ System.out.println("You failed");
  301.                                  }
  302.                                  }
  303.                                  
  304.                              }
  305.                              if (c == 3) {
  306.                                  System.out.println();
  307.                                  System.out.println("Level 8");
  308.                                  System.out.println();
  309.                                  System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  310.                                  System.out.println("|   What is  |");
  311.                                  System.out.println("|  34*99     |");
  312.                                  System.out.println("|      ?     |");
  313.                                  System.out.println("| _______|");
  314.                                  System.out.println(" A__A  || ");
  315.                                  System.out.println("(•ㅅ•) || ");
  316.                                  System.out.println("/   づ");
  317.                                  System.out.println("");
  318.                                  System.out.println("You have two chances to answer the questions.");
  319.                                  
  320.                                  System.out.println("Enter the answer");
  321.                                  c = www.nextDouble() ;
  322.                                  if (c == 331) {
  323.                                  System.out.println("Well done!! It's right!");
  324.                                  } else  {
  325.                                       System.out.println("It's wrong");  
  326.                                      
  327.                                       System.out.println("Try again");
  328.                                      c = www.nextDouble() ;
  329.                                      while (c == 1);
  330.                                      if (c == 331) {
  331.                                          System.out.println("Well done!! you're right!");
  332.                                      }
  333.                                      
  334.                                      else{ System.out.println("Try again");
  335.                                      c = www.nextDouble() ;
  336.                                      while (c == 1);
  337.                                      if (c == 331) {
  338.                                          System.out.println("Well done!! you're right!");
  339.                                      }
  340.                                      else{ System.out.println("You failed");
  341.                                      }
  342.                                      }
  343.                                      
  344.                                  }
  345.                                  if (c == 331) {
  346.                                      System.out.println();
  347.                                      System.out.println("Level 9");
  348.                                      System.out.println();
  349.                                      System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  350.                                      System.out.println("|   What is  |");
  351.                                      System.out.println("|  800*120   |");
  352.                                      System.out.println("|      ?     |");
  353.                                      System.out.println("| _______|");
  354.                                      System.out.println(" A__A  || ");
  355.                                      System.out.println("(•ㅅ•) || ");
  356.                                      System.out.println("/   づ");
  357.                                      System.out.println("");
  358.                                      System.out.println("You have two chances to answer the questions.");
  359.  
  360.                                      System.out.println("Enter the answer");
  361.                                      c = www.nextDouble() ;
  362.                                      if (c == 96000) {
  363.                                      System.out.println("Well done!! It's right!");
  364.                                      } else  {
  365.                                           System.out.println("It's wrong");  
  366.                                          
  367.                                           System.out.println("Try again");
  368.                                          c = www.nextDouble() ;
  369.                                          while (c == 1);
  370.                                          if (c == 96000) {
  371.                                              System.out.println("Well done!! you're right!");
  372.                                          }
  373.                                          
  374.                                          else{ System.out.println("Try again");
  375.                                          c = www.nextDouble() ;
  376.                                          while (c == 1);
  377.                                          if (c == 96000) {
  378.                                              System.out.println("Well done!! you're right!");
  379.                                          }
  380.                                          else{ System.out.println("You failed");
  381.                                          }
  382.                                          }
  383.                                          
  384.                                  
  385.                                      }
  386.                                      if (c == 96000) {
  387.                                          System.out.println();
  388.                                          System.out.println("Level 10");
  389.                                          System.out.println();
  390.                                          System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
  391.                                          System.out.println("|   What is  |");
  392.                                          System.out.println("| 999*999    |");
  393.                                          System.out.println("|      ?     |");
  394.                                          System.out.println("| _______|");
  395.                                          System.out.println(" A__A  || ");
  396.                                          System.out.println("(•ㅅ•) || ");
  397.                                          System.out.println("/   づ");
  398.                                          System.out.println("");
  399.                                          System.out.println("You have two chances to answer the questions.");
  400.  
  401.                                          System.out.println("Enter the answer");
  402.                                          c = www.nextDouble() ;
  403.                                          if (c == 998001) {
  404.                                          System.out.println("Well done!! It's right!");
  405.                                          } else  {
  406.                                               System.out.println("It's wrong bro");  
  407.                                              
  408.                                               System.out.println("Try again");
  409.                                              c = www.nextDouble() ;
  410.                                              while (c == 1);
  411.                                              if (c == 998001) {
  412.                                                  System.out.println("Well done!! you're right!");
  413.                                              }
  414.                                              
  415.                                              else{ System.out.println("Try again");
  416.                                              c = www.nextDouble() ;
  417.                                              while (c == 1);
  418.                                              if (c == 998001) {
  419.                                                  System.out.println("Well done!! you're right!");
  420.                                              }
  421.                                              else{ System.out.println("You failed");
  422.                                              }
  423.                                              }
  424.                                            
  425.                                              if (c == 998001) {
  426.                                              System.out.println();
  427.                                              System.out.println("Excellent "+s+" !!");
  428.                                              }
  429.                                            
  430.                                          }
  431.                                                  
  432.                                          
  433.                                              }
  434.                                              
  435.      
  436.   }
  437.  }
  438.  }
  439.                        
  440.                              }
  441.                          }
  442.                      
  443.          
  444. }
  445. }
Advertisement
Add Comment
Please, Sign In to add comment