If Statement #39 (Like Jeopardy, but emotionless.)

Code

/// Name: Amir Salehi
/// Period: 7
/// Program Name: A little Quiz
/// File Name: ALittleQuiz.java
/// Date Finished: 10/19/2015

import java.util.Scanner;

public class ALittleQuiz {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        int choice1, choice2, choice3, choice4, choice5, numCorrect = 0;

        System.out.println("Q1) What is the capital of Morocco?");
        System.out.println("\t1) Casablanca.");
        System.out.println("\t2) Marakesh.");
        System.out.println("\t3) Rabat.");
        System.out.print("\n> ");

        choice1 = input.nextInt();
        System.out.println();
        if (choice1 == 3) {
            System.out.println("That's correct!");
            numCorrect++;
        } else {
            System.out.println("Sorry, that's incorrect, The correct answer is Rabat");
        }
        System.out.println();

        System.out.println("Q2) What does the Stars on the American flag represent?");
        System.out.println("\t1) Its Independence");
        System.out.println("\t2) The Number of States");
        System.out.println("\t3) FREEDOM");
        System.out.println("\t4) The lives who died in glory");
        System.out.print("\n> ");

        choice2 = input.nextInt();
        System.out.println();
        if (choice2 == 2) {
            System.out.println("That's correct!");
            numCorrect++;
        } else {
            System.out.println("Sorry, that's incorrect, The answer is the number of states.");
        }
        System.out.println();

        System.out.println("Q3) What's the most popular (Or Common) type of government today?");
        System.out.println("\t1) Socialism");
        System.out.println("\t2) Communism");
        System.out.println("\t3) Capitalism");
        System.out.println("\t4) Totalism");
        System.out.println("\t5) Fachism");
        System.out.println("\t6) Theocracy");
        System.out.println("\t7) Republic");
        System.out.print("\n> ");

        choice3 = input.nextInt();
        System.out.println();
        if (choice3 == 7) {
            System.out.println("That's correct!");
            numCorrect++;
        } else {
            System.out.println("Sorry, that's incorrect, The correct answer is Republic");
        }
        System.out.println();

        System.out.println("Q4) What is the next step for Humanity?");
        System.out.println("\t1) Holographic phones");
        System.out.println("\t2) Virtual Reality");
        System.out.println("\t3) Electro Magnetic Drive");
        System.out.println("\t5) Colonizing Mars");
        System.out.print("\n> ");

        choice4 = input.nextInt();
        System.out.println();
        if (choice4 == 5) {
            System.out.println("That's correct!");
            numCorrect++;
        } else {
            System.out.println("Sorry, that's incorrect, During latest news it seems that the space race is continuing.");
        }
        System.out.println();
        
        System.out.println("Q5) What is the most economical country?");
        System.out.println("\t1) China");
        System.out.println("\t2) America");
        System.out.println("\t3) Germany");
        System.out.println("\t4) Britain");
        System.out.println("\t5) India");
        System.out.print("\n> ");

        choice5 = input.nextInt();
        System.out.println();
        if (choice5 == 3) {
            System.out.println("That's correct!");
            numCorrect++;
        } else {
            System.out.println("Sorry, that's incorrect, During recent statistics it seems that Germany is the Most economical County");
        }
        System.out.println();
        
        System.out.println("Looks like you got " + numCorrect + " / 5 correct.");
        System.out.println("Thanks for playing! Share with with your friends.( If you feel like it.)");

    }

}

<-->(Work in Progress)
    

Picture of the output

Assignment 7

Back to Homepage