Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Creating a quiz (really basic doubt)

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Creating a quiz (really basic doubt)

    hey uh this is my problem, i'm a student in 10th grade and we have to make a quiz. So we have to use multiple classes (Quiz class (the main class), Levels class, Result Class). My thing is that i have a member variable in Levels Class (whose value is changed in each method, and each method is a different subject), but whenever i call the variable in Result class the value is returned as zero). So could someone tell me what i should do?? i'm posting the Quiz and Levels class(which is kinda big) here.

    package project;
     
    /**
     * Write a description of class Quiz here.
     * 
     * @author (your name) 
     * @version (a version number or a date)
     */
     
    import java.io.*;
    public class Quiz
    {
     
        Regulations obj1=new Regulations();
        Levels obj=new Levels();
        Result obj2=new Result();
        int k=0;
        int a =0;
        public void main()throws IOException
        {
            InputStreamReader read=new InputStreamReader (System.in);
            BufferedReader buff=new BufferedReader (read);
            System.out.println("\t\t\t\t\t\t-------------------??Guess What??-------------------");
            System.out.println("WELCOME TO GUESS WHAT? A QUIZ GAME THAT WILL TEST YOUR GENERAL KNOWLEDGE TO THE MAXIMUM POTENTIAL. \n TO START PLEASE CHOOSE YOUR DIFFICULTY LEVEL.\n\n");
            obj1.rules();
            while(true)
            {
            System.out.println("Enter 1 for LEVEL 1");
            System.out.println("Enter 2 for LEVEL 2");        
            System.out.println("Enter 3 for LEVEL 3");
            System.out.println("Enter 4 to QUIT");        
            do
            {
                System.out.println("Please choose your level");
                try
                {
                    a=Integer.parseInt(buff.readLine());
                }
                catch(NumberFormatException obj)
                {
                    System.out.println("Please enter a number");
                    System.out.println(obj.getMessage());
                    continue;
                }
                break;
            }while(true);
            switch(a)
            {
                case 1:
                obj.Level1();
                k++;
                break;
                case 2:
                obj.Level2();
                k++;
                break;
                case 3:
                obj.Level3();
                k++;
                break;
                case 4:
                System.out.println("Had enough?? Well I understand, however recommend this quiz to your friends and watch them squirm and scratch THEIR heads in wonder!!! Then maybe you won't feel so bad!!");
                System.out.println("Your details are : ");
                obj2.calculate();
                System.exit(1);
                break;
                default:
                System.out.println("Please restart the program and enter a number between 1 and 4");
            }
        }
       }
    }

    Levels Class
    package project;
     
     
    /**
     * Write a description of class Levels here.
     * 
     * @author (your name) 
     * @version (a version number or a date)
     */
    import java.io.*;
    public class Levels
    {   
        int point=0;
        long i=0;
        int ch=0;
        int ch1=0, ch2=0, ch3=0,ch4=0,ch5=0,ch6=0,ch7=0,ch8=0,ch9=0;
        public void Level1()throws IOException
        {
            int k=0;
            InputStreamReader read=new InputStreamReader(System.in);
            BufferedReader buff=new BufferedReader(read);
            System.out.println("You have chosen Level 1. The subject is History and the topics are: ");
            for(i=0; i<100000000; i++);
            System.out.println("1.Mythology");
            for(i=0; i<100000000; i++);
            System.out.println("2.Literature");
            for(i=0; i<100000000; i++);
            System.out.println("3.Empires and Rulers");
            for(i=0; i<100000000; i++);
            System.out.println("4.Quit");
            System.out.println("Please choose one of the above topics ");
            ch=Integer.parseInt(buff.readLine());
            switch(ch)
            {
                case 1:
                ch1++;
                if(ch1>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN");
                    break;
                }
                System.out.println("Mythology is the culmination of the beliefs of people all around the world and hence it is instrumental in understanding the various \ncultures present in this world. However, the most striking fact about mythology is that there is an uncanny resemblance between the beliefs of all the old civilizations. \nPerhaps there is some larger force at work which we cannot comprehend........but for now try comprehending these questions!"); 
                System.out.println("Question 1) What is the common link between Phaeton, Apollo and Ra? \nA)They are fire gods\t B)They are all Greek gods \nC)These gods do not exist      D)They are all metaphysical manifestations of the Sun.");
                String n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 2)Andromeda was chained to a rock and offered as a sacrifice to a sea serpent, but was saved by a hero. \nWho was the hero? (Hint: He used a certain Gorgons head) \nA)Perseus \tB)Luke \nC)Centaur \tD)Hercules");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question3)If Cerberus was the three headed guardian dog of Hades, who is Charon?\nA) The gatekeeper of Hades.\tB)The boatman of the river Styx \nC)The judge of the dead Souls \tD)None of the above");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 4) The “Twelve Labours of Hercules” is the most famous account of Hercules’s adventures.\n However, who was the person who sent him on these adventures?\nA)King Midas \tB)Agamemnon\nC)King Eurystheus\t D)King Calmedues");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 5) In Norse Mythology, Loki a malicious god was responsible for many problems. However which of the following incidents were not connected to Loki?\nA)Death of  Balder \tB)Capture of Idunn\nC) Creation of the fishing net \tD)Death of Skadi");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 6)Who was the creator of the universe, according to Hindu Mythology?\nA)Brahma \tB)Vishnu \nC)Shiva \tD)Krishna");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 7) Which dog headed Egytpian god was responsible for the judgement of souls in the Underworld?\nA)Ra \tB)Osiris \nC)Isis \tD)Anubis");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 8)The golden fleece, was an object well sought for by Jason and the _________?\nA)Argonauts \tB)Helionauts \nC)Cargonauts \tD)Astroanuts ");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 9)With reference to Central and South American mythology, who were called as 'The People of the Sun?\nA) Inca \tB)Mayans \nC)Zapotecs \tD)Aztecs  "); 
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 10)In Hindu Mythology, when the gods were churning the ocean for the creation of immortal nectar, \nwhat did Vishnu convert himself into in order to help the gods?\nA) Kurma the tortoise \tB)Matsya the Fish \nC)Varah the Boar \tD) Vamana the Dwarf"); 
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Your points for this topic are: "+point);
     
                break;
                case 2:
                ch2++;
                if(ch2>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN");
                    break;
                }
                    System.out.println("Though literature may seem strange as a subtopic of History, its placement could not have been better. \nWhen we come to think about it, a huge part of our ancient history has been rediscovered from our ancient texts and hence Literature does from an important aspect of our historical knowledge. Now it’s the time to test your ‘Literrati’ knowledge!");
                    System.out.println("");
                    System.out.println("Question 1)Cave paintings are important as they give us an insight into the mind of the early man(Of the Upper Old Stone Age era). So where were the first cave paintings discovered?\nA)Nice, France \tB)Chanton, Spain \nC) Lascaux, France \tD)Stonehenge, England");
                    n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 2)What form of writing was used by the Sumerians?\nA)Cuneiform \tB)Pictograph \nC)Hieroglyphics \tD)Palintihic ");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 3)Which book was been cited as, 'the bane of scientific advancement durng Dark Age in Europe?\nA)The Book of Genesis \tB)The Bible \nC)The Book Of Truth \tD)The Catholic Church");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 4)Who wrote the two famous books about the rise and fall of Gabirel, the heavenly Angel, called Paradise Lost and Pardise Regained?\nA)Chaucer \tB)John Milton \nC)da Vinci \tD)Christopher Marlowe");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
     
                System.out.println("Question 5)Miss Marple, Parker Pyne and Hastings are the creations of which famous crime novelist?\nA)Enid Blyton \tB)Charles Osborne \nC)Agathta Christie \tD)George Elliot");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
     
                System.out.println("Question 6) Jeeves and Wooster are the brainchildren of which master writer? \nA)P.G. Wodehouse \tB)Kareyn Rithard \nC)Bill Bryson \tD)John Masefield");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 7)Bill Bryson is one of the most prolific scientific and reasearch/writer. What book has he won acclaim for?\nA)A Short History of Nearly Everything \tB)The Universe: In A Nutshell \nC)Decoding Homo Sapiens \tD)Explorations of a Newcomer?");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 8)What English word comes from the Arabic term, amir-albahr, meaning 'Commander of the Sea'? \nA)Corporal \tB)Captain \nC)Master \tD)Admiral");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 9)In Shakespeare's Hamlet, who was the King of Denmark?\nA)Claudius \tB)Gareth \nC)Ferdinand \tD)Mraxes");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 10)Who wrote the Sanskrit play, Meghdoot?\nA)Jaishankar Prasad \tB)Kalidas \nC)Chandragupta \tD)Valmiki");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Your total points so far: "+point);
                break;
                case 3:
                ch3++;
                if(ch3>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN");
                    break;
                }
                      System.out.println("If shoes maketh the man, then empires maketh history. The rise and fall of Empires and the vibrant culture each one had is perhaps \nthe most interesting and engrossing part about the past. However, there are some small facts about the civilizations long \ngone by that are not printed in history books………care to find out?");         
                System.out.println("");
                System.out.println("Question 1)Which was the first country to issue postage stamps? \nA)Britain \tB)China \nC)Denmark \tD)Russia");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 2)During the Renaissance, which country commissioned the most number of projects?\nA)Spain \tB)Italy \nC)France \tD)Germany");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 3)By what name are the Swiss states known as?\nA)Partons \tB)Carusos \nC)Cantons \tD)Fascens");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 4)With which empire is Otto Van Bismarck associated?\nA)Russia \tB)Poland \nC)Austria \tD)Germany");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Qusetion 5)Prince Albert was the husband of which famous 'Empress'?\nA)Queen Victoria \tB)Queen Elizabeth \nC)Dutchess of Kent \tD)Queen Anne");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 6)Which Duke defeated Napolean at the Battle of Waterloo?\nA)Duke of Kensington \tB)Duke of Waterloo \nC)Duke of Harringotn \tD)Duke of Wellington");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 7)Who was the famous Monarch who said 'If they cannot eat bread, let them eat cake!'?\nA)Marie Antoinette \tB)Queen Anne \nC)Queen Isabelle \tD)Queen Lousie");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 8)In which city is Windsor castle located? (Hint: England)\nA)Windsor \tB)London \nC)Essex \tD)Sussex ");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 9)Which queen was said to have had a whirlwind romance with Mark Anthony?\nA)Queen Nefertitti \tB)Queen Dido \nC)Queen Hadiense \tD)Queen Cleopatra");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 10)'I was the man behind the Spanish Revolution, who am I?\nA)Carl Guereva \tB)Simon Huarcata \nC)Simon Bolivia \tD)Simon Bolivar");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Your total points so far: "+point);
     
                break;
                case 4:
                System.out.println("You have left Level 1");
                break;
                default: 
                System.out.println("The quiz making you tired ALREADY?? Take a break and choose between 1-3");
              }
    }
    public void Level2()throws IOException
    {
     
            InputStreamReader read=new InputStreamReader(System.in);
            BufferedReader buff=new BufferedReader(read);
            System.out.println("You have chosen Level 2. The subject is Entertainment and the topics are: ");
            for(i=0; i<100000000; i++);
            System.out.println("1.Music");
            for(i=0; i<100000000; i++);
            System.out.println("2.Movies");
            for(i=0; i<100000000; i++);
            System.out.println("3.Sports");
            for(i=0; i<100000000; i++);
            System.out.println("4.Quit");
            System.out.println("Please choose one of the above topics ");
            ch=Integer.parseInt(buff.readLine());
            i=0;
            switch(ch)
            {
                case 1:
                ch4++;
                if(ch4>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN");
                    break;
                }
                System.out.println("Music is the food of the soul, and due to it’s varied forms everyone has their own likes and dislikes. Ranging from Punk Rock to Devotional, from \nClassical to Hip-hop, from Dance beats to country music, it has covered every possible Genre and style, with new avenues opening each day.\nI’d suggest that you take a break, listen to some songs and then come and attempt this subject…….");
                System.out.println();
                System.out.println("Question 1) Which band launched the world famous album, 'Dark Side of the Moon'\nA)Pink Floyd \tB)Led Zeppelin \nC)Aerosmith \tD)Astro-nots");
                String n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 2)‘Ozzy Osbourne', was the frontman for which band?’\nA)Guns n Roses \tB)Black Sabbath \nC)Childless \tD)Moon-Spinners");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 3)‘Joe Dassin is a singer of which nationality?\nA)Russian \tB)Swedish \nC)French \tD)English");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 4)Which band released an album entitled Wish You Were Here?\nA)Black Sabbath \tB)Carsons \nC)Pink Floyd \tD)Mettalica");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 5)How many Strings does an Ukele have?\nA)Six \tB)Four \nC)Five \tD)A Ukele is not a musical instrument");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 6)Who released a 1975 album entitled Captain Fantastic and the Brown Dirt Cowboy?\nA)Elton John \tB)Marc Lewis \nC)Cliff Richards \tD)Elvis Presely");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 7)What was the Oscar winning song from the 1987 film Dirty Dancing?\nA)It's Time \tB)We Gotta Party \nC)Moonspin \tD)Time of My Life");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 8)Which rock band was the first to perform at New York's metropolitan opera house?\nA)The Doors \tB)The Rolling Stones \nC)The Who \tD)Aerosmith");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 9)What has been described as the song that is sung the most?\nA)Bhaage Re Mann \tB)Happy Birthday \nC)Boogie Woogie \tD)None of the above");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 10)Which musical instrument is derived from the italian word, soft and loud?\nA)Guitar \tB)Trombone \nC)Saxophone \tD)Piano");
                 n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Your points this far :"+point);
                break;
                case 2:
                ch5++;
                if(ch5>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN");
                    break;
                }
                System.out.println("Movies, Cinema, Motion Pictures, call it what you want, for years movies have been the mode of communication and entertainment. It brings forth to \nus expressions of freedom, love, joy, misery and sympathy and it is for these emotions that we are known as humans. The Silver screen has \nlong been the home and guiding light for many aspiring stars and famous personalites and has been a turning point for many a \nperson's career. However lets see if you can create a blockbuster performance yourself");
                System.out.println();
                System.out.println("Question 1)What was the first motion picture about?\nA)A moving train \tB)A fish swimming \nC)Indiana Jones \tD)Opera Singing");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 2)TRUE OR FALSE! Samuel L Jackson was unknown to evryone till he acted in Pulp Fiction\nA)True\nB)False");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 3)Which of these actors NEVER played James Bond?\nA)George Lazenby \tB)Roger Moore \nC)Timothy Dalton \tD)Gene Kelly");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("What is the breed of the dog in the movie, Marley and Me?\nA)Golden Retriever \tB)Labrador \nC)Alsatian \tD)None of the above");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 4)Which state is Forrest Gump from?\nA)Mississippi \tB)Iowa \nC)Alabama \tD)Texas");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 5)What is the name of the turtle in Finding Nemo?\nA)Crash \tB)Crush \nC)Brush \tD)Drush");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 6)In which movie did Leonardo Di Caprio star, in which he ran away from home, became a pilot, a doctor, a lawyer all before his 19th birhday?\nA)Runaway Jerry \tB)Catch Me if You Can \nC)The Juvenile \tD)None of the above");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 7)In the movie In Pursuit of Happyness, how is Will Smith's character's son related to him in real life?\nA)Stepfather and Stepson \tB)Uncle and Nephew \nC)Father and Son \tD)They are not related");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 8)The Ivory Tower appears in which all time great movie?\nA)The Never Ending Story \tB)The Lord of The Rings: The Two Towers \nC)Willow \tD)The Lord of the Rings: The Return of the King");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 9)In Grease, the T'Birds have a constant feud with which gang?\nA)The Fangs \tB)The Dragons \nC)The Scorpions \tD)The Gators");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 10)TRUE OR FALSE: There were no African-American actors in the movie Grease?\nA)False \tB)True");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Would you like to try a bonus question? (+5 points)\nA)Yes \nB)No");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("Which Indian director has a panache of making very long films?\nA)RGV \tB)Abbas Tyrewala \nC)Yash Chopra \tD)Sanjay Leela Bhansali");
                    n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point=point+10;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
     
                }
                System.out.println("Your points so far: "+point);
                break;
                case 3:
                System.out.println("Man thrives on competition, because as humans, we still belong to the animal kingdom and the old age Darwinian principle of the Survival of the Fittest still thrives in our blood.\nHowever, in this cultured world this trait can only be displayed in one arena: Sports (or in the streets of Mumbai and Kolkata). We take our sports very seriously, and it is this love \nfor sports which causes our pulse to race, our happiness reaches unimaginable heights, even if another country may win the Football World Cup. Anyhow, lets see what is your \nsporting quotient.");
                System.out.println("");
                if(ch6>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN!");
                    break;
                }
                System.out.println("Question 1)In which country was ex-England cricket captain Tony Greig born?\nA)South Africa \tB)England \nC)Australia \tD)India ");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 2)In which sport does your team only have to travel 3.6 metres to win?\nA)Hurdles \tB)Tug of War \nC)Relay \tD)Cockroach Racing");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 3)Is Brian Lara left or right handed when batting?\nA)Left \tB)Right");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 4)What animal is on the top of the Calcutta Cup Trophy?\nA)Tiger \tB)Lion \nC)Elephant \tD)None");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 5)What do Sumo wrestlers throw into the ring prior to a match?\nA)Sand \tB)Carbon \nC)Ash \tD)Salt");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 6)How many players are there in a netball team?\nA)Eight \tB)Six \nC)Seven \tD)Five");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 7)In motor racing what colour flag is used to denote 'danger, no overtaking'?\nA)Yellow with red stripes \tB)Yellow \nC)Red \td)Blue");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 8)In which sport can you throw a 'curve ball'?\nA)Bowling \tB)Cricket \nC)Hockey \tD)Baseball");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 9)Which sport takes place in an area 32ft (9.75 metres) long by 21ft (6.40 metres) wide, using a ball which weighs approximately 24 grams (0.85 ounces)?\nA)Squash \tB)Tennis \nC)Table Tennis \tD)Billiards");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 10)In which year did Roger Bannister run the first mile in under 4 minutes?\nA)1844 \tB)1854 \nC)1954 \tD)1855");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Your points so far: "+point);
                case 4:
                System.out.println("You have left Level 2");
                break;
                default: System.out.println("The quiz making you tired? Take a break and choose between 1-3"); 
         }
    }
    public void Level3()throws IOException
    {
            InputStreamReader read=new InputStreamReader(System.in);
            BufferedReader buff=new BufferedReader(read);
            System.out.println("You have chosen Level 3.Please be advised this is the toughest level in this quiz and in any other quiz.You have been warned. The subject is Science and the topics are: ");
            for(i=0; i<100000000; i++);
            System.out.println("1.Physics");
            for(i=0; i<100000000; i++);
            System.out.println("2.Biology");
            for(i=0; i<100000000; i++);
            System.out.println("3.Chemistry");
            for(i=0; i<100000000; i++);
            System.out.println("4.Quit");
            System.out.println("Please choose one of the above topics ");
            ch=Integer.parseInt(buff.readLine());
            i=0;
            int ch1=0, ch2=0, ch3=0;
            switch(ch)
            {
                case 1:
                ch7++;
                if(ch7>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN");
                    break;
                }
                System.out.println("Phsysics, the study of the forces and everything else that keeps this universe in motion is the most exciting field of Science. We have come a long way from dropping two lead balls \nfrom an unstable tower, and today we have gone as far smashing atoms millions of times smaller than those affore mention balls at almost the speed of light. Yet as Einstein very \ncorrectly stated 'We have come a long way indeed, but we have a much longer way still to go'"); 
                System.out.println();
                System.out.println("Question 1)What phenomenon is known as 'EDDY'S CURRENT'?\nA)Setting up of magnetic fields in a DC generatior \nB)Setting up of magnetic fields in an AC generatior \nC)Setting up of an electrical field inside a generator \nD)Flow of magnetic field around the earth");
                String n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 2)Where is the Event Horizon located?\nA)Above a Black hole \tB)Below a Black hole \nC)Inside a Black hole \tD)The Surface of the Black hole");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 3)When Isaac Newton was famous, a woman came to him and asked him to use his 'magic' and find her lost purse. What did he do?\nA)Gave her some money and sent her off \nB)Used a probabilty theorem and couple it with a calculus to find the location \nC)Said the words ABRACADABRA, and set her off to look around Royal Navy Hospital\nD)None of the above");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C). Believe me!");
                }
                System.out.println("Question 4)TRUE OR FALSE: In the 1840's a ship from Uruguay fired cheese balls to fend off an attacking ship\nA)True \nB)False");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A). Its true, the cheese flew so fast, that it actually managed \nto wreck the sails of the ship!");
                }
                System.out.println("Question 5)Traditional Tennis rackets got their springiness from_______\nA)Rubber \tB)Carbon \nC)Sheep's intestine \tD)Wool");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C). Its true, It took about seven dead sheep to make the racket");
                }
                System.out.println("Question 6)What will happen to the International Space Station, if there is a nuclear explosion somewhere on Earth?\nA)Nothing \tB)The Space Staion will blow up \nC)The heat willl disintegrate the Space Station \tD)All astronauts on board will be blinded");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C). Believe me!");
                }
                System.out.println("Question 7) TRUE OR FALSE: If you run against the rotation of the earth, you will lose weight\nA)True \nB)False");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B). Believe me!");
                }
                System.out.println("Question 8)Which of the following is NOT related to refraction?\nA)Oval shape of the sun during sunrise and sunset \tB)Twinkling of stars \nC)A mirage in a desert \tD)Objects in the mirror appearing closer than they really are");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D). Believe me!");
                }
                System.out.println("Question 9)What is the lightest object which can be dropped from the Empire State Building, which can kill a man?\nA)Rubber ball \tB)Mobile phone \nC)A penny \tD)A Rupee coin");
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C). Believe me!");
                }
                System.out.println("According to Physicists protons, neutrons and electrons consist of quarks, which in turn consist of_______?\nA)Strings \tB)Charges \nC)Nothing \tD)Gluons");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A). Believe me!");
                }
                System.out.println("Your points this far: "+point);
                break;
                case 2:
                ch8++;
                if(ch8>1)
                {
                    System.out.println("YOU CANNOT ATTEMPT THIS SUBJECT AGAIN");
                    break;
                }
                System.out.println("Biology, the study if life all around us, and well, us...For years Biology has been one of the most elusive subjects, for it was extremely difficult for botanists, zoologists, \necologists and palentheologists to sift through the enormous amount of fauna and flora that exists and had existed in this world. Let's see if you can handle these questions first");
                System.out.println();
                System.out.println("Question 1) If you stretched out all the roots in a tennis court size garden, they would cover.......?\nA)Twice the distance to Mars \nB)Once the distance to the Moon \nC)Twice the distance to the Moon \nD)The circumference of the Earth");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 2)What makes tourists stand on the banks of Lake Akan in Japan and stare at the water?\nA)Plants that dive up and down.\tB)Vegetarian Crocodiles \nC)The boiling water \tD)Proffesional Divers holding their breath for 4 min");
                n=buff.readLine(); 
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 3)What is so special about the Phyllostachys?\nA)It might splatter you with green slime \tB)It flowers every 120 years \nC)It grows only in volcanic regions \tD)The leaves are razor sharp");
                n=buff.readLine(); 
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 4)In which of the following places can you NOT find microbes?\nA)Deep in a frozen lake in the Antarctic\tB)The mouth of a lobster \nC)In an active volcano in Switzerland \tD)ON hand sanitizer bottles");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 5)TRUE OR FALSE: The tarantula spider fires tiny spears at mice\nA)False \nB)True");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 6)A blowfly can taste food through it's feet. So what can the ichneumon(ick-noy-mon) fly do?(Hint: FEET!)\nA)Jump 20 feet in the air \nB)Hear and smell through its feet \nC)Survive a Nuclear explosion three feet from ground zero \nD)Kill a spider only with its feet");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 7)What is tougher than a nylon fishing line and ten times tougher than kevlar?\nA)Spider web \tB)Flies intestine \nC)Turtle shells \tD)Hummingbird's heart muscles");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 8)What books do bonobos at Twycross Zoo, England like getting for Christams?\nA)Bonobos don't read books \tB)Books about chimps \nC)Twycross Zoo hasn't got Bonobos \tD)Science textbooks");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B). BONOBOS ARE CHIMPS,THEY CANT READ THE BOOK BUT THEY DO KISS THE PICTURES! ");
                }
                System.out.println("Question 9)Comohoridae fish live in Lake Bykal in Siberia, if you leave them in the sun they melt and die, what other special quality do they have?\nA)They can walk on water \tB)They can swim backwards \nC)They have see through bodies \tD)They use a navigation system similar to SONAR");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).Their body is composed of oily fat.");
                }
                System.out.println("Question 10)TRUE OR FALSE: Pneumonoultramicroscopicsilicovolcanoconiosis (new-mo-nool-tra-mi-cro-scop-pic-sill-lick-co-vol-cay-no-co-nee-o-sis");
                System.out.println("Is a disease affecting the lungs AND the heart?\nA)True \nB)False");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B). IT AFFECTS ONLY THE LUNGS");
                }
                System.out.println("Your points so far: "+point);
                break;
                case 3:
                System.out.println("Welcome to the last topic of this quiz, chemistry.(That is if you truthfully attempted all the other levels first!). Chemistry was one of the first branches of Science to be understood by humans, as records show alchemy, mixing of various chemicals and even usage of acids has been understood and adapted by man throughout time. So wake that inner chemist in you and take a pot shot at these questions if you dare......"); 
                System.out.println();
                System.out.println("Question1)Just a pinch of _________ can fill an entire stadium full of a nasty smell.What is it?\nA)Vanillaldehyde\tB)Methyl Mercaptan \nC)Hydrogen Sulphide \tD)Methane");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 2)In what substance can you find 'bucky bunnys' and 'bucky onions'?\nA)Gold \tB)Lead \nC)Carbon \tD)Sulpur");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 3)Fencing rapiers and jet planes are made of....?\nA)Aluminium \tB)Kevlar \nC)Steel \tD)Carbon Fiber");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 4)In the 1870s some chewing gum contained.....?\nA)Sulphuric acid  \tB)Paraffin \nC)Honey \tD)Cheese");
                n=buff.readLine();
                if(n.equalsIgnoreCase("B"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is B).");
                }
                System.out.println("Question 5)Which of these products do NOT contain seaweed?\nA)Headache pills \tB)Shaving Cream \nC)Light Bulbs \tD)Miso soup");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 6)TRUE OR FALSE: Chocolate gets some of its taste from the same chemical found in Spinach\nA)True \nB)False");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 7)H-Spon was invented by US scientists in 1974, what can it do?\nA)Kill bacteria found in the Intesrine \tB)A radioactive 'tracer' chemical \nC)Suck up 1300 times its weight in water. \tD)Used to form Carbon fibre");
                n=buff.readLine();
                if(n.equalsIgnoreCase("C"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is C).");
                }
                System.out.println("Question 8)How do Antarctic fishg survive in sub-zero temperatures?\nA)They have layers of body fat \tB)They swim near the surface of the water \nC)They keep swimming and eating to provide warmth to their bodies \tD)Their blood conatins 'anti-freeze'");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is D).");
                }
                System.out.println("Question 9)TRUE OR FALSE: Iron and its alloys contain carbon.\nA)True \nB)False");
                n=buff.readLine();
                if(n.equalsIgnoreCase("A"))
                {
                    System.out.println("That is the right answer!");
                    point++;
                }
                else
                {
                    System.out.println("I am sorry that is the wrong answer. The correct answer is A).");
                }
                System.out.println("Question 10)What state is glass in?\nA)Solid \tB)Gaseous \nC)Liquid \tD)Liquid-Solid");
                n=buff.readLine();
                if(n.equalsIgnoreCase("D"))
                {
                    System.out.println("That is the right answer! Very good! I hope that was not a guess?");
                    point++;
                }
                else
                {
                    System.out.println("The correct answer is D). Don't believe me? Well glass in terms of molecular and thermodynamics is actually a very highly viscous liquid which does not flow \nThis is because glass has a very weak crystal bonding which has not become a soild yet. So thefore calling glass either a solid or a liquid is not completely correct.");
     
                }
                break;
                case 4:
                System.out.println("Well you were correct in your choice, but you COULD have TRIED, you know? Now leaving Level 3");
                break;
                default:
                System.out.println("The quiz making you tired? Take a break and choose between 1-3");
     
     
            }
    }
     
    }


  2. #2
    Junior Member
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Creating a quiz (really basic doubt)

    oh yeah and the member variable in Levels is called point.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Creating a quiz (really basic doubt)

    Sorry, but nobody is going to want to read through that much unformatted code. I suggest you break your problem down into an SSCCE that shows the bare minimum. And don't forget the code tags.

Similar Threads

  1. Quiz application
    By JonoF in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: May 10th, 2010, 06:06 AM
  2. Doubt regarding LIST
    By puneetsr in forum Collections and Generics
    Replies: 1
    Last Post: February 23rd, 2010, 04:19 PM
  3. Replies: 2
    Last Post: October 29th, 2009, 06:13 PM
  4. math quiz program
    By hope.knykcah in forum Collections and Generics
    Replies: 1
    Last Post: October 23rd, 2009, 09:53 AM
  5. Which javadoc tag is used to denote a comment for a method parameter?
    By TARUN JORA in forum Java Theory & Questions
    Replies: 2
    Last Post: May 15th, 2009, 04:30 PM