All pastes #798308 Raw Edit

Something

public text v1 · immutable
#798308 ·published 2007-11-26 19:10 UTC
rendered paste body
import java.util.Scanner;

class quiz
{
    public static void main (String[] args)
    {
        Scanner scan = new Scanner (System.in);
        int answer1, answer2, answer3, answer4, answer5, answer6, answer7, answer8, answer9, answer10;
        
                     
        final int answer12 = 256;
        final int answer22 = 8;
        final int answer32 = 1966;
        final int answer42 = 3;
        final int answer52 = 10;
        final int answer62 = 2;
        final int answer72 = 3;
        final int answer82 = 1;
        final int answer92 = 2;
        final int answer102 = 4;
        
        System.out.println("Welcome to the quiz! good luck!" );
        System.out.println("\n1.  What is 16\u00B2 ?: " );
        answer1 = scan.nextInt();
        System.out.println("\n2.  How many planets are there in the solar system ?: " );
        answer2 = scan.nextInt();
        System.out.println("\n3.  In what year did england win the football world cup ?: " );
        answer3 = scan.nextInt();
        System.out.println("\n4.  What game this year became the offical all time fastest selling videogame ?\n1)fifa 08\n2)bioshock\n3)halo3\n4)half-life2 " );
        answer4 = scan.nextInt();
        System.out.println("\n5.  How many weeks was rhianna's no.1 hit Umbrella at the top of the charts for ?: " );
        answer5 = scan.nextInt();
        System.out.println("\n6.  Who is the all time most sucessful artist ? \n1)Cliff Richard\n2)Elvis Presley\n3)Michael Jackson\n4)The Beatles" );
        answer6 = scan.nextInt();
        System.out.println("\n7.  Which of these is the most sucessful film franchise ?\n1)James Bond\n2)Star Wars\n3)Harry Potter\n4)Lord of the Rings" );
        answer7 = scan.nextInt();
        System.out.println("\n8.  Which of these was the first ever video game console ? \n1)Magnavox Odyssey\n2)Atari 400\n3)Nintendo NES\n4)Famicom" );
        answer8 = scan.nextInt();
        System.out.println("\n9.  How many wonders of the world are there ? \n1)...6\n2)...7\n3)...8\n4)...9" );
        answer9 = scan.nextInt();
        System.out.println("\n10.  February is the shortest month in the year, but which is the longest? \n1)March\n2)June\n3)September\n4)October" );
        answer10 = scan.nextInt();
        
        int points = 0;
        
        
        System.out.println("\n\nCongratulations on completing the Sam Cook quiz, here are your results: " );
        if (answer1 != answer12)
        {
            System.out.println ( "\n1.Incorrect    -    The correct answer is 256");
        }
        
        else
        {
            points++;
            System.out.println ( "\n1.Correct");
        }
            
        if (answer2 != answer22)
        {
            System.out.println ( "2.Incorrect    -    The correct answer is 8");
        }
        else
        {
            points++;
            System.out.println ( "2.Correct");
        }
        
        if (answer3 != answer32)
        {
            System.out.println ( "3.Incorrect    -    The correct answer is 1966");
        }
        else
        {
            points++;
            System.out.println ( "3.Correct");
        }
        
        if (answer4 != answer42)
        {
            System.out.println ( "4.Incorrect    -    The correct answer is Halo3 you n00b!");
        }
        else
        {
            points++;
            System.out.println ( "4.Correct");
        }
        
        if (answer5 != answer52)
        {
            System.out.println ( "5.Incorrect    -    The correct answer is 10 weeks");
        }
        else
        {
            points++;
            System.out.println ( "5.Correct");
        }
        
        if (answer6 != answer62)
        {
            System.out.println ( "6.Incorrect    -    The correct answer is Elvis Presley");
        }
        else
        {
            points++;
            System.out.println ( "6.Correct");
        }
        
        if (answer7 != answer72)
        {
            System.out.println ( "7.Incorrect    -    The correct answer is Harry Potter");
        }
        else
        {
            points++;
            System.out.println ( "7.Correct");
        }
        
        if (answer8 != answer82)
        {
            System.out.println ( "8.Incorrect    -    The correct answer is the Magnavox Odyssey");
        }
        else
        {
            points++;
            System.out.println ( "8.Correct");
        }
        
        if (answer9 != answer92)
        {
            System.out.println ( "9.Incorrect    -    The correct answer is 7");
        }
        else
        {
            points++;
            System.out.println ( "9.Correct");
        }
        
        if (answer10 != answer102)
        {
            System.out.println ( "10.Incorrect    -    The correct answer is October, because the clocks go back so it lasts 31 days and 1 hr");
        }
        else
        {
            points++;
            System.out.println ( "10.Correct");
        }
        
        System.out.println ( "\nYou scored " + points +" out of 10");
        
        
        
    }
}