Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /***********************************************************************************************************************
- * Created by IntelliJ IDEA.
- * User: Alan
- * Date: 15/11/11
- * Time: 17:50
- * Leet program
- **********************************************************************************************************************/
- public class MobileGamesSection
- {
- static Scanner keyboard = new Scanner(System.in);
- static String correctAnswer, incorrectAnswer = "Incorrect! No points for you!";
- static int questionOneAnswer, questionTwoAnswer, questionThreeAnswer, questionFourAnswer, questionFiveAnswer, menuChoice, score;
- public static void mobileGamesMenu()
- { //Menu System
- System.out.println("Welcome to the Mobile Games section of the quiz!");
- System.out.println("Would you like to go straight to the quiz or would you like a brief training section on Mobile Games? If you would prefer you can also go back to the main menu.");
- System.out.println("1. Start the quiz");
- System.out.println("2. Start the training");
- System.out.println("3. Back to main menu");
- System.out.println("If a non-valid choice is entered you will be returned to this menu.");
- System.out.print("What would you like to do? ");
- menuChoice = keyboard.nextInt();
- System.out.println("");
- switch (menuChoice)
- { case 1:
- mobileGamesQuizMenu();
- break;
- case 2:
- mobileGamesTrainingMenu();
- break;
- case 3:
- menuTopic();
- break;
- default:
- mobileGamesMenu();
- }//switch
- }//mobileGamesMenu
- public static void mobileGamesQuizMenu()
- {
- System.out.println("Welcome to the Mobile Games Quiz!");
- System.out.println("What difficultly level would you like to attempt?");
- System.out.println("1: Easy");
- System.out.println("2: Medium");
- System.out.println("3: Hard");
- System.out.println("4: Back to Mobile Games Menu\t\t5: Back to Topic List");
- System.out.println("If a non-valid choice is entered you will be returned to this menu.");
- System.out.print("What would you like to do? ");
- menuChoice = keyboard.nextInt();
- System.out.println("");
- switch (menuChoice)
- {
- case 1:
- mobileGamesQuizEasy();
- break;
- case 2:
- mobileGamesQuizMedium();
- break;
- case 3:
- mobileGamesQuizHard();
- break;
- case 4:
- mobileGamesMenu();
- break;
- case 5:
- menuTopic();
- break;
- default:
- mobileGamesQuizMenu();
- }//switch
- }//mobileGamesQuizMenu
- public static void mobileGamesQuizEasy()
- {
- int easyScore = 0;
- questionOneAnswer = 1;
- questionTwoAnswer = 3;
- questionThreeAnswer = 4;
- questionFourAnswer = 2;
- questionFiveAnswer = 1;
- correctAnswer = "Correct! You get 5 points!";
- //Start of Quiz
- //Question 1
- System.out.println("Easy Difficulty Section");
- System.out.println("Question 1. What are the birds trying to kill in Angry Birds? ");
- System.out.println("1: Pigs");
- System.out.println("2: Sheep");
- System.out.println("3: Mice");
- System.out.println("4: Cows");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionOneAnswer)
- {
- System.out.println(correctAnswer);
- easyScore+=5;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 1
- //Question 2
- System.out.println("Question 2. Complete the game name - Cut the _ _ _ _? ");
- System.out.println("1: Cheese");
- System.out.println("2: Chicken");
- System.out.println("3: Rope");
- System.out.println("4: Fruit");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionTwoAnswer)
- {
- System.out.println(correctAnswer);
- easyScore+=5;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 2
- //Question 3
- System.out.println("Question 3. Answer is 4? ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionThreeAnswer)
- {
- System.out.println(correctAnswer);
- easyScore+=5;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 3
- //Question 4
- System.out.println("Question 4. Answer is 2? ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionFourAnswer)
- {
- System.out.println(correctAnswer);
- easyScore+=5;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 4
- //Question 5
- System.out.println("Question 5. Answer is 1 ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionFiveAnswer)
- {
- System.out.println(correctAnswer);
- easyScore+=5;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 5
- //End of Quiz
- //Beginning of Summary
- System.out.println("Your final score for this section is: " + easyScore);
- System.out.println("You have reached the end of the easy section of the quiz.\n");
- System.out.println("From here you can choose to go to:");
- System.out.println("1: Medium Quiz\t\t2: Quiz Menu");
- System.out.println("If a non-valid choice is entered you will be returned to the quiz menu.");
- System.out.print("What would you like to do? ");
- System.out.println("");
- menuChoice = keyboard.nextInt();
- switch (menuChoice)
- {
- case 1: mobileGamesQuizMedium();
- break;
- case 2: mobileGamesQuizMenu();
- break;
- default: mobileGamesQuizMenu();
- }//switch
- //End of summary
- //End of easy difficulty section
- }//mobileGamesQuizEasy
- public static void mobileGamesQuizMedium()
- {
- int mediumScore = 0;
- questionOneAnswer = 1;
- questionTwoAnswer = 1;
- questionThreeAnswer = 1;
- questionFourAnswer = 1;
- questionFiveAnswer = 1;
- correctAnswer = "Correct! You get 10 points!";
- //Start of Quiz
- //Question 1
- System.out.println("Medium Difficulty Section");
- System.out.println("Question 1. Answer is 1? ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionOneAnswer)
- {
- System.out.println(correctAnswer);
- mediumScore+=10;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 1
- //Question 2
- System.out.println("Question 2. Answer is 1? ");
- System.out.println("1: Cheese");
- System.out.println("2: Chicken");
- System.out.println("3: Rope");
- System.out.println("4: Fruit");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionTwoAnswer)
- {
- System.out.println(correctAnswer);
- mediumScore+=10;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 2
- //Question 3
- System.out.println("Question 3. Answer is 1? ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionThreeAnswer)
- {
- System.out.println(correctAnswer);
- mediumScore+=10;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 3
- //Question 4
- System.out.println("Question 4. Answer is 1? ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionFourAnswer)
- {
- System.out.println(correctAnswer);
- mediumScore+=10;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 4
- //Question 5
- System.out.println("Question 5. Answer is 1 ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionFiveAnswer)
- {
- System.out.println(correctAnswer);
- mediumScore+=10;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 5
- //End of Quiz
- //Summary
- System.out.println("Your final score for this section is: " + mediumScore);
- System.out.println("You have reached the end of the hard section of the quiz.\n");
- System.out.println("From here you can choose to go to:");
- System.out.println("1: Hard Quiz\t\t2: Quiz Menu");
- System.out.println("If a non-valid choice is entered you will be returned to the quiz menu.");
- System.out.print("What would you like to do? ");
- menuChoice = keyboard.nextInt();
- switch (menuChoice)
- {
- case 1: mobileGamesQuizHard();
- break;
- case 2: mobileGamesQuizMenu();
- break;
- default: mobileGamesQuizMenu();
- }//switch
- //End of Medium difficulty section
- }//mobileGamesQuizMedium
- public static void mobileGamesQuizHard()
- {
- int hardScore = 0;
- questionOneAnswer = 1;
- questionTwoAnswer = 1;
- questionThreeAnswer = 1;
- questionFourAnswer = 1;
- questionFiveAnswer = 1;
- correctAnswer = "Correct! You get 15 points!";
- //Start of Quiz
- //Question 1
- System.out.println("Hard Difficulty Section");
- System.out.println("Question 1. Answer 1? ");
- System.out.println("1: 1");
- System.out.println("2: 1");
- System.out.println("3: 1");
- System.out.println("4: 1");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionOneAnswer)
- {
- System.out.println(correctAnswer);
- hardScore+=15;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 1
- //Question 2
- System.out.println("Question 2. Answer is 1? ");
- System.out.println("1: Cheese");
- System.out.println("2: Chicken");
- System.out.println("3: Rope");
- System.out.println("4: Fruit");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionTwoAnswer)
- {
- System.out.println(correctAnswer);
- hardScore+=15;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 2
- //Question 3
- System.out.println("Question 3. Answer is 1? ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionThreeAnswer)
- {
- System.out.println(correctAnswer);
- hardScore+=15;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 3
- //Question 4
- System.out.println("Question 4. Answer is 1? ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionFourAnswer)
- {
- System.out.println(correctAnswer);
- hardScore+=15;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 4
- //Question 5
- System.out.println("Question 5. Answer is 1 ");
- System.out.println("1: ");
- System.out.println("2: ");
- System.out.println("3: ");
- System.out.println("4: ");
- System.out.print("Please enter your answer here: ");
- menuChoice = keyboard.nextInt();
- if (menuChoice == questionFiveAnswer)
- {
- System.out.println(correctAnswer);
- hardScore+=15;
- }//if
- else
- {
- System.out.println(incorrectAnswer);
- }//else
- System.out.println("");
- //End of Question 5
- //End of Quiz
- //Summary
- System.out.println("Your final score for this section is: " + hardScore);
- System.out.println("You have reached the end of the hard section of the quiz.\n");
- System.out.println("From here you can choose to go to:");
- System.out.println("1: Main Menu\t\t2: Quiz Menu");
- System.out.println("If a non-valid choice is entered you will be returned to the quiz menu.");
- System.out.print("What would you like to do? ");
- menuChoice = keyboard.nextInt();
- switch (menuChoice)
- {
- case 1: menuTopic();
- break;
- case 2: mobileGamesQuizMenu();
- break;
- default: mobileGamesQuizMenu();
- }//switch
- //End of Quiz
- //End of hard difficulty section
- }//mobileGamesQuizHard
- public static void mobileGamesTrainingMenu()
- {
- System.out.println("Welcome to the Mobile Games Tutorial!");
- System.out.println("What difficultly level would you like help with?");
- System.out.println("1: Easy");
- System.out.println("2: Medium");
- System.out.println("3: Hard");
- System.out.println("4: Back to Mobile Games Menu\t\t5: Back to Topic List");
- System.out.println("If a non-valid choice is entered you will be returned to this menu.");
- System.out.print("What would you like to do? ");
- menuChoice = keyboard.nextInt();
- System.out.println("");
- switch (menuChoice)
- {
- case 1:
- mobileGamesTrainingEasy();
- break;
- case 2:
- mobileGamesTrainingMedium();
- break;
- case 3:
- mobileGamesTrainingHard();
- break;
- case 4:
- mobileGamesMenu();
- break;
- case 5:
- menuTopic();
- break;
- default:
- mobileGamesTrainingMenu();
- }//switch
- }//mobileGamesTrainingMenu
- public static void mobileGamesTrainingEasy()
- {
- System.out.println("Easy Tutorial Section");
- System.out.println("This is the tutorial where you can learn about mobile games. You will be tested on it in quizzes after.\n");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis\n ");
- //Summary
- System.out.println("You have reached the end of the easy section of the tutorial.\n");
- System.out.println("From here you can choose to go to:");
- System.out.println("1: Easy Quiz\t\t2: Tutorial Menu");
- System.out.println("If a non-valid choice is entered you will be returned to the quiz menu.");
- System.out.print("What would you like to do? ");
- System.out.println("");
- menuChoice = keyboard.nextInt();
- switch (menuChoice)
- {
- case 1: mobileGamesQuizEasy();
- break;
- case 2: mobileGamesTrainingMenu();
- break;
- default:mobileGamesTrainingMenu();
- }//switch
- }//mobileGamesTrainingEasy
- public static void mobileGamesTrainingMedium()
- {
- System.out.println("Medium Tutorial Section");
- System.out.println("This is the tutorial where you can learn about mobile games. You will be tested on it in quizzes after.\n");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis\n ");
- //Summary
- System.out.println("You have reached the end of the medium section of the tutorial.\n");
- System.out.println("From here you can choose to go to:");
- System.out.println("1: Medium Quiz\t\t2: Tutorial Menu");
- System.out.println("If a non-valid choice is entered you will be returned to the quiz menu.");
- System.out.print("What would you like to do? ");
- System.out.println("");
- menuChoice = keyboard.nextInt();
- switch (menuChoice)
- {
- case 1: mobileGamesQuizMedium();
- break;
- case 2: mobileGamesTrainingMenu();
- break;
- default:mobileGamesTrainingMenu();
- }//switch
- }//mobileGamesTrainingMedium
- public static void mobileGamesTrainingHard()
- {
- System.out.println("Medium Tutorial Section");
- System.out.println("This is the tutorial where you can learn about mobile games. You will be tested on it in quizzes after.\n");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis ");
- System.out.println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum mattis dapibus nisl eu ornare. Vivamus hendrerit eros quis\n ");
- //Summary
- System.out.println("You have reached the end of the medium section of the tutorial.\n");
- System.out.println("From here you can choose to go to:");
- System.out.println("1: Hard Quiz\t\t2: Tutorial Menu");
- System.out.println("If a non-valid choice is entered you will be returned to the quiz menu.");
- System.out.print("What would you like to do? ");
- System.out.println("");
- menuChoice = keyboard.nextInt();
- switch (menuChoice)
- {
- case 1: mobileGamesQuizHard();
- break;
- case 2: mobileGamesTrainingMenu();
- break;
- default:mobileGamesTrainingMenu();
- }//switch
- }//mobileGamesTrainingHard
- public static void menuTopic()
- {
- System.out.println("Welcome to our Information System on Video Games!");
- System.out.println("This is the list of topics available: ");
- System.out.println("1. Xbox Games");
- System.out.println("2. Wii Games");
- System.out.println("3. PS3 Games");
- System.out.println("4. PC Games");
- System.out.println("5. Classic Games");
- System.out.println("6. Mobile Games");
- System.out.println("7. DS Games");
- System.out.println("8. What kind of gamer are you quiz");
- System.out.println("9. Exit the System");
- System.out.println("If a non-valid choice is entered system will exit.");
- System.out.print("What would you like to do? ");
- menuChoice = keyboard.nextInt();
- System.out.println("");
- switch (menuChoice)
- {
- case 1:
- break;
- case 2:
- break;
- case 3:
- break;
- case 4:
- break;
- case 5:
- break;
- case 6:
- mobileGamesMenu();
- break;
- case 7:
- break;
- case 8:
- break;
- case 9:
- exitSystem();
- break;
- default:
- exitSystem();
- }//switch
- }//menuTopic
- public static void exitSystem()
- {
- System.exit(0);
- }//exitSystem
- public static void main(String[] args)
- {
- menuTopic();
- }//main
- }//class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement