Aparna
2010-06-08 12:05:28 UTC
import java.util.*;
public class KBC
{ String questions[];
String options[][];
int answers[];
long money[];
public KBC()
{ questions = new String[]
{ " Where is Fort William located ?",
" Name this Indian Tennis player who has turned Hollywood filmmaker?",
" Sishu is the literary work of which Indian author?",
" Which of these Cities located in the state of Gujarat is famous for zari production?",
" Which State in India is the largest producer of Soyabean?",
" The western ghats in Maharashtra is known as...?",
" On which riverbank is Goa located?",
" Which state is known as India's Spice Garden...?",
" Thumba in Kerala is famous because...?",
" Which of these places is not located in Mumbai?",
" Name the annual fair of Rajasthan that is famous for its camel trading event...?",
" Which Indian State has most airports?",
" Name the oldest mountain range of India...?",
" Rouff is a folk dance. It has its origin in ...?",
" Located in India it is Asia's largest residential university. Name it...?"
};
options = new String[][]
{
{ "1.Chennai","2.Goa","3.Kolkata","4.Mysore"},
{"1.Leander Paes","2.Mahesh Bhupathi","3. Vijay Amritraj","4.Ashok Amritraj"},
{"1.Vikram Seth","2.Jawaharlal Nehru","3.Rabindranath Tagore","4.Arundhati Roy"},
{"1.Surat","2.Rajkot","3.Surendranagar","4.Ahmedabad"},
{"1.Rajasthan","2.Gujarat","3.Uttar Pradesh","4.Madhya Pradesh"},
{"1.Nilgiris","2.Sahyadris ","3.Cardamon Hills","4.Annamalai"},
{"1.Ganga","2.Mandovi","3.Gomati","4.Sabarmati"},
{"1.Kerala","2.Karnataka","3.Bihar","4.Uttaranchal"},
{"1.It has several industries","2.It is a rocket launching station","3.It is a harbour","4.It has an international airport"},
{"1.The Gateway of India","2.The Kamala Nehru Park","3.The Juhu Beach","4.The Charminar"},
{"1.Pushkar Mela","2.Kumbha Mela","3.Sonepur Mela","4.Suraj Kund Mela"},
{"1.Maharashtra","2.Madhya Pradesh","3.Kerala","4.Gujarat"},
{"1.Himalayas","2.Nilgiris","3.Aravallis","4.Vindhyas"},
{"1.Himachal Pradesh","2.Assam","3.Mizoram","4.Kashmir"},
{"1.Banaras Hindu University","2.The Utkal University","3.Jawaharlal Nehru University","4.Anna University"}
};
answers = new int[]
{3,4,3,1,4,2,2,1,2,4,1,4,3,4,1};
money = new long[]
{ 1000,2000,3000,5000,10000,20000,40000,80000,160000,320000,640000,1250000,2500000,5000000,10000000};
}
public int getRandomQues()
{ int i = (int)((Math.random()*15)+1);
return i ;
}
public int[] getHistory(int i)
{ int k;
int arr[]=new int[15];
arr[k]=i;
k++;
return arr;
}
public static void main( String args[])
{ Scanner sc = new Scanner(System.in);
KBC obj = new KBC();
static int ctr;
int choice=0;
for(int k=0;k!=obj.questions.length;k++)
{ int i= obj.getRandomQues();
boolean res;
if(ctr>0)
{
int q[]=obj.getHistory(i);
for( int t=0;t!=q.length;t++)
{ if(i!=q[t])
res=true;
else
res=false;
}
if(res==true)
{
{ System.out.println( k+1+" : " + obj.questions[i]);
System.out.println(obj.options[i][0]);
System.out.println(obj.options[i][1]);
System.out.println(obj.options[i][2]);
System.out.println(obj.options[i][3]);
}
System.out.println(" Enter your choice(1/2/3/4)");
choice = Integer.parseInt(sc.nextLine());
if(choice==obj.answers[i])
System.out.println("You have won : " + obj.money[k]);
else
{ System.out.println(" G.A.M.E O.V.E.R S.U.C.K.ER ");
break;
}
}
else
continue;
}
ctr++;
}
}
}