Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Are you ready for a quiz? (Y/N) ");
- char begin = input.next().charAt(0);
- int score = 0;
- if (begin == 'Y' || begin =='y'){
- System.out.println("OK, here it comes.");
- System.out.println("\nQ1 What is the most coolest subject to take at DP?");
- System.out.println("\t\t1) Design");
- System.out.println("\t\t2) Computer Science");
- System.out.println("\t\t3) What is DP?");
- System.out.print("\n> ");
- int question1 = input.nextInt();
- System.out.println();
- if(question1 == 2){
- System.out.println("That is right!");
- score ++;
- } else{
- System.out.println("Incorrect");
- }
- System.out.println("\nQ2 If Mr Doyle was a cat, what colour would the grass be?");
- System.out.println("\t\t1) Seven");
- System.out.println("\t\t2) Green");
- System.out.println("\t\t3) Dog");
- System.out.print("\n> ");
- int question2 = input.nextInt();
- System.out.println();
- if(question2 == 2){
- System.out.println("That is right!");
- score ++;
- } else{
- System.out.println("Incorrect");
- }
- System.out.println("\nQ3 Can you elbow?");
- System.out.println("\t\t1) Yes");
- System.out.println("\t\t2) No");
- System.out.print("\n> ");
- int question3 = input.nextInt();
- System.out.println();
- if(question3 == 1){
- System.out.println("Haha you just tried to lick your elbow (and you are incorrect)");
- } else{
- System.out.println("Correct it is not possible to lick your elbow");
- score ++;
- }
- System.out.println("\nOverall you got " + score + " out of 3 correct.");
- System.out.println("Thanks for playing.");
- }else{
- System.out.println("Ok then! Don't take my super awesome quiz, see if I care.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment