Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Quiz
- {
- public static void main(String[] args)
- {
- int score = 0;
- Scanner scan = new Scanner(System.in);
- System.out.println("Welcome to the Personality Quiz: Are you more Type A or Type B? \n First, what is your name?");
- String name = scan.nextLine();
- System.out.println("Welcome " + name + "!");
- System.out.println("Lets Begin!");
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println( "Question 1:\n"
- + "You have a test on Friday. It's monday, when do you start studying?\n"
- + "1. Tonight\n"
- + "2. Thursday night");
- System.out.println("Type the number of your answer here:");
- int a1 = scan.nextInt();
- if(a1 == 1)
- {
- score = score - 5;
- }
- else if(a1 == 2)
- {
- score = score + 5;
- }
- else
- {
- System.out.println("Invalid Answer. START AGAIN.");
- System.exit(0);
- }
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println("Question 2:\n"
- + "You're at a house party where you know no one, your only friend leaves early.\n What do you do? \n"
- + "1. Try to make new friends\n "
- + "2. Leave immediately");
- System.out.println("Type the number of your answer here:");
- int a2 = scan.nextInt();
- if(a2 == 1)
- {
- score = score + 5;
- }
- else if (a2 == 2)
- {
- score = score - 5;
- }
- else
- {
- System.out.println("Invalid Answer. START AGAIN.");
- System.exit(0);
- }
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println("Question 3: \n"
- + "You're babysitting two little boys, they ask you to play checkers. How do you play? \n"
- + "1. Play a fair game \n"
- + "2. Let the kids win");
- System.out.println("Type the number of your answer here:");
- int a3= scan.nextInt();
- if (a3 == 1)
- {
- score= score -5;
- }
- else if (a3 == 2)
- {
- score= score + 5;
- }
- else
- {
- System.out.println("Invalid Answer. START AGAIN.");
- }
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println("Question 4: \n"
- + "A young girl is kicking your seat from behind on a long airplane flight. What do you do about it?\n"
- + "1. Turn around and immediately tell them to stop \n"
- + "2. Try to ignore it");
- System.out.println("Type the number of your answer here:");
- int a4 = scan.nextInt();
- if (a4 == 1)
- {
- score = score - 5;
- }
- else if (a4 == 2)
- {
- score = score + 5;
- }
- else
- {
- System.out.println("Invalid Answer. START AGAIN");
- }
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println("Question 5: \n"
- + "You bus leaves at 7:15 am. What time do you wake up? \n"
- + "1. 6:00 am /n"
- + "2. 7:00 am");
- System.out.println("Type the number of your answer here:");
- int a5 = scan.nextInt();
- if (a5 == 1)
- {
- score = score - 5;
- }
- else if (a5 == 2)
- {
- score = score + 5;
- }
- else
- {
- System.out.println("Invalid Answer. START AGAIN.");
- }
- System.out.println();
- System.out.println();
- System.out.println();
- System.out.println("Question 6: /n"
- + "You just failed a math test that you studied a lot for, and you feel horrible. What do you do?\n"
- + "1. Talk to your teacher or parents \n"
- + "2. Keep it to yourself, and study for the next test");
- System.out.println("Type the number of your answer here:");
- int a6= scan.nextInt();
- if (a6 ==1 )
- {
- score = score + 5;
- }
- else if (a6 == 2)
- {
- score = score - 5;
- }
- else
- {
- System.out.println("Invalid Answer. START AGAIN.");
- }
- if (score>0)
- {
- System.out.println("You are Type B Personality. You take life as it goes and live freely /n"
- + "Showing up on time is not a priority to you. ");
- }
- if (score<0)
- {
- System.out.println("You are Type A Personality. You tend to live life closer to a schedule and \n"+
- "you also tend to be less outgoing and more of a wallflower.");
- }
- if (score==0)
- {
- System.out.println("You are neither type A nor type B");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement