Quiz Game Program in JAVA for ICSE
Quiz Game Program in JAVA
Quiz Program Project in JAVA for ICSE Students:-
User is asked to give answers of 40 questions. For every correct answer 1 point is added in the score. At the end Final Score will be displayed.
Run program in Bluej for organised and better result.
Program below :-
import java.io.*;
import java.util.*;
class Quiz
{
public static void main(String args[])
{
int ans, score=0;
Scanner in= new Scanner(System.in);
{
{
System.out.println("Q1: What was Charles Dickens's last novel?");
System.out.println("1. Oliver Twist");
System.out.println("2. A Tale of two cities");
System.out.println("3. The Mystery of Edwin Drood");
System.out.println("4. Little Doorit");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q2: Who was the first Governor-General of Bengal?");
System.out.println("1. Robert Clive");
System.out.println("2. William Bentinck");
System.out.println("3. Wellesley");
System.out.println("4. Warren Hatings");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==4)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 4");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q3: Who ruled England when East India Company came into existence?");
System.out.println("1. Hanovarians");
System.out.println("2. Stuarts");
System.out.println("3. Normans");
System.out.println("4. None of the above");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q4: What was the first of JRR Tolkien's Novel that was published after his death?");
System.out.println("1. The Two Towers");
System.out.println("2. The Return of the King");
System.out.println("3. The Silmarillion");
System.out.println("4. The Hobbit");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q5: What is the largest non polar desert in the world?");
System.out.println("1. Arabian Desert");
System.out.println("2. Gobi Desert");
System.out.println("3. Sahara Desert");
System.out.println("4. Great Victoria");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q6: What was the first English Newspaper in India?");
System.out.println("1. The Bengal Gazette");
System.out.println("2. The Calcutta Gazette");
System.out.println("3. The Bengal Journal");
System.out.println("4. The Bombay Herald");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==1)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 1");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q7: Which city is also known as the Floating City?");
System.out.println("1. London");
System.out.println("2. New York City");
System.out.println("3. Mumbai");
System.out.println("4. Venice");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==4)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 4");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q8: Which of these novels would be considered Dystopian?");
System.out.println("1. David Copperfield");
System.out.println("2. Anna Karenina");
System.out.println("3. Little Women");
System.out.println("4. Brave New World");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==4)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 4");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q9: On what novel is the film Slumdog Millionaire based?");
System.out.println("1. The Great Gatsby");
System.out.println("2. Q & A");
System.out.println("3. Kim");
System.out.println("4. Gunga Din");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q10: Which planet in solar system is the hottest?");
System.out.println("1. Mercury");
System.out.println("2. Venus");
System.out.println("3. Mars");
System.out.println("4. Jupiter");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q11: When was the First Battle of Panipat fought?");
System.out.println("1. 1589");
System.out.println("2. 1626");
System.out.println("3. 1526");
System.out.println("4. 1689");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q12: What is the national animal of China?");
System.out.println("1. Panda");
System.out.println("2. Lion");
System.out.println("3. Tiger");
System.out.println("4. Dragon");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==1)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 1");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q13: What is the color of the skin of a Polar Bear?");
System.out.println("1. White");
System.out.println("2. Brown");
System.out.println("3. Black");
System.out.println("4. Pink");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q14: How many states does India have?");
System.out.println("1. 28");
System.out.println("2. 29");
System.out.println("3. 30");
System.out.println("4. 27");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q15: What pigment is responsible for red color of the blood?");
System.out.println("1. Chlorophyll");
System.out.println("2. Iron Oxide");
System.out.println("3. Haemoglobin");
System.out.println("4. Stomata");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q16: What is the full form printer company of HP?");
System.out.println("1. Hindustan Printers");
System.out.println("2. Harry Potter");
System.out.println("3. Haier Printers");
System.out.println("4. Hewlett-Packard");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==4)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 4");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q17: Which of the following countries is the host of 2016 Olympic Games?");
System.out.println("1. Brazil");
System.out.println("2. Italy");
System.out.println("3. United Kingdom");
System.out.println("4. South Africa");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==1)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 1");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q18: The Coucil of States in India is generally known as:");
System.out.println("1. Rajya Sabha");
System.out.println("2. Lok Sabha");
System.out.println("3. Parliament");
System.out.println("4. None of the Above");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==1)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 1");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q19: Which is the only man made structure that can be seen from outer space?");
System.out.println("1. Taj Mahal");
System.out.println("2. Leaning Tower of Pisa");
System.out.println("3. Great Wall of China");
System.out.println("4. Pyramid of Giza");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q20: Before the beginning of continental drift all the continents formed one large landmass. What was the name of this landmass?");
System.out.println("1. India");
System.out.println("2. Pangaea");
System.out.println("3. Pandora");
System.out.println("4. United Earth");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q21: What type of lens called a diverging lens?");
System.out.println("1. Cylindrical Lens");
System.out.println("2. Concave Lens");
System.out.println("3. Convex Lens");
System.out.println("4. All of the Above");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q22: Which of the following has an icy core with a tail of gas and dust that extends millions of miles?");
System.out.println("1. Star");
System.out.println("2. Comet");
System.out.println("3. Asteroid");
System.out.println("4. Moon");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q23: Which kind of waves are used to make and receive cellphone calls?");
System.out.println("1. Radio Waves");
System.out.println("2. Visible Light Waves");
System.out.println("3. Sound Waves");
System.out.println("4. Gravity Waves");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==1)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 1");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q24: Which layer of Earth is the hottest layer?");
System.out.println("1. Crust");
System.out.println("2. Mental");
System.out.println("3. Core");
System.out.println("4. None of these");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q25: Which of these is the main way the ocean tides are created?");
System.out.println("1. Rotation of Earth");
System.out.println("2. Gravitational Pull of Moon");
System.out.println("3. Gravitational Pull of Sun");
System.out.println("4. None of these");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q26: What does a light year measure?");
System.out.println("1. Brightness");
System.out.println("2. Time");
System.out.println("3. Distance");
System.out.println("4. Weight");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q27: In general as the altitude increases the temperature ____________.");
System.out.println("1. Increases");
System.out.println("2. Decreases");
System.out.println("3. Stays Same");
System.out.println("4. Not General Answer");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q28: What property of sound wave determines its loudness?");
System.out.println("1. Frequency");
System.out.println("2. Wavelength");
System.out.println("3. Velocity or Rate of Change");
System.out.println("4. Amplitude");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==4)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 4");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q29: Which of these elements is needed to make nuclear energy?");
System.out.println("1. Sodium chloride");
System.out.println("2. Uranium");
System.out.println("3. Nitrogen");
System.out.println("4. Carbon dioxide");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q30: Who developed Polio vaccine?");
System.out.println("1. Marie Curie");
System.out.println("2. Issac Newton");
System.out.println("3. Albert Einstein");
System.out.println("4. Jonas Salk");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==4)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 4");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q31: Which of these terms is defined as the study of how the positions of stars and planets can influence human behavior?");
System.out.println("1. Astrology");
System.out.println("2. Alchemy");
System.out.println("3. Astronomy");
System.out.println("4. Meteorology");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==1)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 1");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q32: How many hearts does an octopus have?");
System.out.println("1. Two");
System.out.println("2. Three");
System.out.println("3. Four");
System.out.println("4. Five");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q33: Which country accounts for 70% of the world's platinum production?");
System.out.println("1. Germany");
System.out.println("2. USA");
System.out.println("3. China");
System.out.println("4. South Africa");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==4)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 4");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q34: Where did British first open their factories in Eastern part of India?");
System.out.println("1. Assam");
System.out.println("2. Orrisa");
System.out.println("3. Bihar");
System.out.println("4. Sikkim");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q35: Who was the first Governor-General of India?");
System.out.println("1. Lord Amherst");
System.out.println("2. Lord William Bentinck");
System.out.println("3. Sir Charles Metcalfe");
System.out.println("4. Robert Clive");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q36: Who declared 'Sati' illegal and punishable?");
System.out.println("1. Lord William Bentinck");
System.out.println("2. Lord Ripon");
System.out.println("3. Lord Canning");
System.out.println("4. Lord Dalhousie");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==1)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 1");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q37: Who is the Author of 'The Da Vinci Code'?");
System.out.println("1. Neal Shustermann");
System.out.println("2. George Orwell");
System.out.println("3. Dan Brown");
System.out.println("4. None of these");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==3)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 3");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q38: What was the first Science Fiction novel?");
System.out.println("1. Dracula");
System.out.println("2. Frankenstein");
System.out.println("3. Stand on Zanzibar");
System.out.println("4. Don Quixote");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q39: Which of these novels was not written in 19th century?");
System.out.println("1. The Old Curiosity Shop");
System.out.println("2. Robinson Crusoe");
System.out.println("3. Little Women");
System.out.println("4. Moby Dick");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Score="+score);
}
}
{
System.out.println("Q40: Who wrote Jane Eyre?");
System.out.println("1. Jane Seymour");
System.out.println("2. Charlotte Bronte");
System.out.println("3. Emily Bronte");
System.out.println("4. Jane Austen");
System.out.println(" Enter your answer");
ans= in.nextInt();
if(ans==2)
{
System.out.println("Correct!");
score= score+1;
System.out.println("Final Score="+score);
}
else
{
System.out.println("Incorrect! Correct answer is: 2");
score=score;
System.out.println("Final Score="+score);
}
}
}
} // end of main method
} // end of class
P.S. - This program is for educational purpose. Students are advised to try and make their own program instead of copying this program.
All the best ☺:)
Comments
Post a Comment