{
int ch;
String name; int score=0;
Scanner s=new Scanner(System.in); public void Display()throws IOException
{
System.out.println("Welcome To IQ Test");
System.out.println("Plese Enter Your Name:->"); name=s.next(); System.out.println("Rules Of IQ Test Are-->\n");
System.out.println("1:You Will Be Asked 30 Questions");
System.out.println("2:Each Question Carries 3 Marks");
System.out.println("3:You Will Be Given Some Options");
System.out.println("4:Wrong Answer Will Deduct Your 3 Points\n");
System.out.println("Ok Ready Then Let's Start IQ Test\n");
}
public void Q()throws IOException
{
System.out.println("\nWhich Animal Cannot Swim?");
System.out.println("1:Turtle 2:Parrot");
System.out.println("3:Mouse 4:Fish");
System.out.println("Enter The Answer :-"); ch=s.nextInt(); if(ch==2)
{
System.out.println("Right Answer!! "+name+"\n"); score+=3; } else {
System.out.println("Wrong Answer!!!"+name+"\n"); score-=3; }
System.out.println("\nIs Black Box Actually Black?");
System.out.println("1:Yes 2:No");
System.out.println("Enter The Answer->"); ch=s.nextInt(); if(ch==2)
{
System.out.println("Right Answer!! "+name+"\n"); score+=3; } else {
System.out.println("Wrong Answer!!! "+name+"\n"); score-=3; }
System.out.println("\nIn Which Country Were The Olympics Games Created ?");
System.out.println("1:India 2:Russia");
System.out.println("3:Greenland 4:Greece");
System.out.println("Enter The Answer->"); ch=s.nextInt(); if(ch==4)
{
System.out.println("Right Answer!! "+name+"\n"); score+=3; } else {
System.out.println("Wrong Answer!!! "+name+"\n"); score-=3; }
System.out.println("\nThere Are Seven Seniors On The Road\nEach One Having The Seven Crutches.\nHow Many Crutches Are At All?");
System.out.println("1:7 2:14");
System.out.println("3:49 4:40");
System.out.println("Enter The Answer->");
ch=s.nextInt();