Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Mathgame {
- public static void main(String args[]){
- String s;
- Scanner scan = new Scanner(System.in);
- System.out.println("Welcome to Mathgame");
- System.out.println("Enter your username");
- s = scan.nextLine();
- System.out.println("Welcome "+s);
- System.out.println();
- System.out.println("Ok, lets start the questions.");
- System.out.println();
- System.out.println("Level 1");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 23 − 11 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- Scanner www = new Scanner(System.in) ;
- double c;
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 12) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 12) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 12) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- if (c == 12) {
- System.out.println();
- System.out.println("Level 2");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 123 − 12 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 111) {
- System.out.println("Well done!! It's right!");
- }
- else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 111) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 111) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- }
- if (c == 111) {
- System.out.println();
- System.out.println("Level 3");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 4^3 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 64) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong0");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 64) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 64) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- }
- if (c == 64) {
- System.out.println();
- System.out.println("Level 4");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 5^2-10 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 15) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 15) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 15) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- }
- if (c == 15) {
- System.out.println();
- System.out.println("Level 5");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 2^3 − 11 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == -3) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == -3) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == -3) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- if (c == -3) {
- System.out.println();
- System.out.println("Level 6");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 9*7 -63 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 0) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 0) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 0) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- if (c == 0) {
- System.out.println();
- System.out.println("Level 7");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| Solve x |");
- System.out.println("| X^2-9=0 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 3) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 3) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 3) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- if (c == 3) {
- System.out.println();
- System.out.println("Level 8");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 34*99 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 331) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 331) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 331) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- if (c == 331) {
- System.out.println();
- System.out.println("Level 9");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 800*120 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 96000) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 96000) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 96000) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- }
- if (c == 96000) {
- System.out.println();
- System.out.println("Level 10");
- System.out.println();
- System.out.println("|  ̄ ̄ ̄ ̄ ̄ ̄ ̄|");
- System.out.println("| What is |");
- System.out.println("| 999*999 |");
- System.out.println("| ? |");
- System.out.println("| _______|");
- System.out.println(" A__A || ");
- System.out.println("(•ㅅ•) || ");
- System.out.println("/ づ");
- System.out.println("");
- System.out.println("You have two chances to answer the questions.");
- System.out.println("Enter the answer");
- c = www.nextDouble() ;
- if (c == 998001) {
- System.out.println("Well done!! It's right!");
- } else {
- System.out.println("It's wrong bro");
- System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 998001) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("Try again");
- c = www.nextDouble() ;
- while (c == 1);
- if (c == 998001) {
- System.out.println("Well done!! you're right!");
- }
- else{ System.out.println("You failed");
- }
- }
- if (c == 998001) {
- System.out.println();
- System.out.println("Excellent "+s+" !!");
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment