Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class sortingHat
- {
- public static void printingStuff()
- {
- Scanner scan = new Scanner(System.in);
- {
- System.out.println ("What's your favourite pet?");
- System.out.println ("A. Guinea Pig");
- System.out.println ("B. A dog");
- System.out.println ("C. A cat");
- System.out.println ("D. other");
- }
- String favouritePetLetter = scan.nextLine();
- if (favouritePetLetter.equals("A"))
- {
- String favouritePet = "guinea pig";
- }
- else if (favouritePetLetter.equals("B"))
- {
- String favouritePet = "dog";
- }
- else if (favouritePetLetter.equals("C"))
- {
- String favouritePet = "cat";
- }
- else
- {
- String favouritePet = "other";
- }
- System.out.println ("What's your favourite car out of:");
- System.out.println ("A. Chevrolet Camaro");
- System.out.println ("B. Chevrolet Suburban");
- System.out.println ("C. Renault Twingo");
- System.out.println ("D. Toyota Corolla");
- String favouriteCarLetter = scan.nextLine();
- if (favouriteCarLetter.equals("A"))
- {
- String favouriteCar = "Chevy Camaro";
- }
- else if (favouriteCarLetter.equals("B"))
- {
- String favouriteCar = "Chevy Suburban";
- }
- else if (favouriteCarLetter.equals("C"))
- {
- String favouriteCar = "Renault Twingo";
- }
- else
- {
- String favouriteCar = "Toyota Corolla";
- }
- System.out.println ("Have you ever crashed a car? y/n");
- String crashedCarValue = scan.nextLine();
- if (crashedCarValue.equals("y"))
- {
- boolean everCrashedCar = true;
- }
- else
- {
- boolean everCrashedCar = false;
- }
- System.out.println ("How many times have you broken a bone?");
- int amountOfTimesBrokenBone = scan.nextLine;
- String house = sortingHat();
- }
- public static String sortingHat (String favouritePet,String favouriteCar,boolean everCrashedCar,int amountOfTimesBrokenBone);
- {
- int Ravenclaw = 0;
- int Gryffindor = 0;
- int Slytherin = 0;
- int Hufflepuff = 0;
- if (favouritePet == "guinea pig")
- {
- int Hufflepuff = Hufflepuff + 1;
- }
- else if (favouritePet == "dog")
- {
- Gryffindor += 1;
- }
- else if (favouritePet == "cat")
- {
- Ravenclaw += 1;
- }
- else
- {
- Slytherin += 1;
- }
- //Only evil people like pets besides the three listed
- if (favouriteCar == "Chevy Camaro")
- {
- Gryffindor += 1;
- //the camaro is dumb, underpowered, impractical, and will only impress the most vapid of people
- //just like gryffindors
- }
- else if (favouriteCar == "Chevy Suburban")
- {
- Slytherin += 1;
- //every evil mercenary's car in every action movie
- }
- else if (favouriteCar == "Renault Twingo")
- {
- Hufflepuff += 1;
- //A little weird, but hard to hate and most likely in on the joke
- }
- else if (favouriteCar == "Toyota Corolla")
- {
- Ravenclaw += 1;
- //Either its the Trueno 86, which is the thinking man's car for drifting, or its the boring car
- //for "that kid" in history class who always argues with the teacher
- }
- //mocking people for their taste in cars is fun
- if (everCrashedCar = true)
- {
- Gryffindor += 1;
- Hufflepuff += 1;
- }
- else
- {
- Slytherin += 1;
- Ravenclaw += 1;
- }
- //gryffindors crashed their car on a dare, hufflepuffs crashed it while spaced out
- if (amountOfTimesBrokenBone < 5)
- {
- Gryffindor += 1;
- //
- }
- else if (amountOfTimesBrokenBone <= 5 && amountOfTimesBrokenBone == 1)
- {
- Hufflepuff += 1;
- }
- else if (amountOfTimesBrokenBone == 1)
- {
- Slytherin += 1;
- }
- else
- {
- Ravenclaw += 1;
- }
- if (Gryffindor > Slytherin && Gryffindor > Ravenclaw && Gryffindor > Hufflepuff)
- {
- return "Gryffindor";
- }
- else if (Slytherin > Gryffindor && Slytherin > Ravenclaw && Slytherin > Hufflepuff)
- {
- return "Slytherin";
- }
- else if (Ravenclaw > Gryffindor && Ravenclaw > Slytherin && Ravenclaw > Hufflepuff)
- {
- return "Ravenclaw";
- }
- else if (Hufflepuff > Gryffindor && Hufflepuff > Slytherin && Hufflepuff > Ravenclaw)
- {
- return "Hufflepuff";
- }
- String house = sortingHat(favouritePet, );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement