/* We all have favourite Superheroes , but which Superhero belongs to you??
* You have to answer some questions.
* The heroes we are taking into account are batman , superman , ironman ,and spiderman.
* Later , you can modify this program to your own convenience , may be you can change the superheroes
*/
MY INPUT |
import java.util.*;//I am using Scanner class to take the input
class WhichSuperHeroareyou
{
public void SuperHero()//The main function
{
int batmn = 0 , supermn = 0 , ironmn = 0 , spidey = 0 ; //The heroes we are taking into account are batman , superman , ironman ,and spiderman.
for(int j = 1;j<2;j++)//To end the program when 'e' is entered
{
Scanner in = new Scanner(System.in);
System.out.println("Welcome to the Quiz - 'Which Super Hero are you ?'");
System.out.println();
System.out.println(" Heroes are a SYMBOL and remember It's not about money or anything but sending a MESSAGE ");
System.out.println();
System.out.println("Kindly Enter your Name ");
String n = in.next();
System.out.println("Hey dear "+n+" ,if you are in a hurry you can press 'e' any time end this 'Interrogation' Scenario although your result will no doubt be declared ");
System.out.println();
System.out.println("Q1. What is your IMAGINERY family background ? ");
System.out.println("a. Gods b. Wealthy Business Tycoons c. Devotees of the Country d. Middle Class Family ");
char q1 = in.next().charAt(0);
if(q1=='a')
supermn++ ;
else if(q1=='b')
{
batmn++;
ironmn++;
}
else if(q1=='c')
{
batmn++;
}
else if(q1=='d')
spidey++;
else if(q1=='e')
break;
System.out.println("Q2. What trait would compel you to become a Hero ?");
System.out.println("a. You are Different from others b. The Death of your Loved ones c. After seeing the miserable condition of the world d. Some incident related to you ");
char q2 = in.next().charAt(0);
if(q2=='a')
supermn++ ;
else if(q2=='b')
spidey++;
else if(q2=='c')
{
ironmn++;
batmn++;
}
else if(q2=='e')
break;
System.out.println("Q3. What SuperPowers do you wanna have (along woth enormous Strength) ?");
System.out.println("a. Intelligence b. Any Power you have inherited from any other animal or so c. Abilty to fly d. Self Made Weapons ");
char q3 = in.next().charAt(0);
if(q3=='a')
batmn++ ;
else if(q3=='b')
spidey++;
else if(q3=='c')
supermn++;
else if(q3=='e')
break;
else
ironmn++;
System.out.println("Q4. Do you want your identity to be Hidden ? ");
System.out.println("a. Yes b. No");
char q4 = in.next().charAt(0);
if(q4=='a')
{
batmn++ ;
spidey++ ;
}
else if(q1=='e')
break;
else
{
supermn++ ;
ironmn++ ;
}
System.out.println("Q5. What would you do if you are supposed to go to a one-way mission and you know that there is no coming back ? ") ;
System.out.println(" a. Search for a backup plan b. Go there without thinking of the consequence c. Help the people in any other way d. Run away w.ith your loved ones ") ;
char q5 = in.next().charAt(0);
if(q5=='a')
batmn++ ;
else if(q5=='b')
supermn++;
else if(q5=='c')
{
spidey++;
ironmn++ ;
}
else if(q5=='e')
break;
System.out.println("Q6. What do you want people to think of you as ? ") ;
System.out.println(" a. You don't give damn b. Their only Hope c. A Freak d. A crazy Billionare having time to do all this idiotic charity ") ;
char q6 = in.next().charAt(0);
if(q6=='a')
batmn++ ;
else if(q6=='b')
supermn++;
else if(q6=='c')
spidey++;
else if(q6=='e')
break;
else
ironmn++;
System.out.println("Q7. If you are stuck at something whom would you take advice from ? ") ;
System.out.println("a. People that you Trust b. You do not need any help or even if you do , you would help yourself out c. Your Family d. Your Business Associates ");
char q7 = in.next().charAt(0);
if(q7=='a')
batmn++ ;
else if(q7=='b')
supermn++;
else if(q7=='c')
spidey++;
else if(q7=='e')
break;
else
ironmn++;
}
if(batmn>=supermn&&batmn>=spidey&&batmn>=ironmn)//If the points of any heroes are equal , then we deal with it in this block
{
if(batmn==supermn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.print(" You are the Great Alien Warrior , Superman , who came from the planet Krypton . No one can defeat you in Strength as well as ");
}
else if(batmn==ironmn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are Ironman played by Robert Downy Jr. the Billionare who became a Super Hero when Kidnapped by a terrorist organisation . You are worthy of a Noble Prize for your contribution in the field of Technology as well as ");
}
else if(batmn==spidey)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are Spiderman , Truly brilliant in your speed and aim . You accidently when bit by a hybrid spider became the great Hero that you are !! &");
}
System.out.println(" You are the Dark Knight The Batman , You fight for Gotham city from the Dark Side . Bruce Wayne has been played by Christian Bale in the Batman Trilogy . You are best in your Intelligence and Fighting Technique that you learnt from Ra's Al Ghul ");
}
if(supermn>=batmn&&supermn>=spidey&&supermn>=ironmn)
{
if(supermn==batmn){
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.print(" You are the Dark Knight The Batman , You fight for Gotham city from the Dark Side . Bruce Wayne has been played by Christian Bale in the Batman Trilogy . You are best in your Intelligence and Fighting Technique that you learnt from Ra's Al Ghul as well as ");
}
else if(supermn==ironmn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are Ironman played by Robert Downy Jr. the Billionare who became a Super Hero when Kidnapped by a terrorist organisation . You are worthy of a Noble Prize for your contribution in the field of Technology as well as ");
}
else if(supermn==spidey)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are Spiderman , Truly brilliant in your speed and aim . You accidently when bit by a hybrid spider became the great Hero that you are !! &");
}
System.out.println(" You are the Great Alien Warrior , Superman , who came from the planet Krypton . No one can defeat you in Strength ");
}
if(spidey>=supermn&&spidey>=batmn&&spidey>=ironmn)
{
if(spidey==batmn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.print(" You are the Dark Knight The Batman , You fight for Gotham city from the Dark Side . Bruce Wayne has been played by Christian Bale in the Batman Trilogy . You are best in your Intelligence and Fighting Technique that you learnt from Ra's Al Ghul as well as ");
}
else if(spidey==ironmn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are Ironman played by Robert Downy Jr. the Billionare who became a Super Hero when Kidnapped by a terrorist organisation . You are worthy of a Noble Prize for your contribution in the field of Technology as well as ");
}
else if(spidey==supermn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are the Great Alien Warrior , Superman , who came from the planet Krypton . No one can defeat you in Strength & ");
}
System.out.println(" You are Spiderman , Truly brilliant in your speed and aim . You accidently when bit by a hybrid spider became the great Hero that you are !!");
}
if(ironmn>=batmn&&ironmn>=spidey&&ironmn>=spidey)
{
if(ironmn==batmn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.print(" You are the Dark Knight The Batman , You fight for Gotham city from the Dark Side . Bruce Wayne has been played by Christian Bale in the Batman Trilogy . You are best in your Intelligence and Fighting Technique that you learnt from Ra's Al Ghul as well as ");
}
else if(ironmn==spidey)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are Spiderman , Truly brilliant in your speed and aim . You accidently when bit by a hybrid spider became the great Hero that you are !! &");
}
else if(ironmn==supermn)
{
System.out.println("Congratulations, You Actually match the traits of two superheroes");
System.out.println(" You are the Great Alien Warrior , Superman , who came from the planet Krypton . No one can defeat you in Strength as well as");
}
System.out.println(" You are Ironman played by Robert Downy Jr. the Billionare who became a Super Hero when Kidnapped by a terrorist organisation . You are worthy of a Noble Prize for your contribution in the field of Technology ");
}
}
}
MY OUTPUT |
*KINDLY EXPRESS YOUR VIEWS REGARDING THE PROGRAM BELOW IN THE COMMENTS SECTION
- SHASHWAT SRIVASTAVA
No comments:
Post a Comment