Harry Potter

Report a typo

Harry Potter needs help identifying what each house means.

Read a string representing a house and output the following:

  • if it is "gryffindor", output "bravery";

  • if it is "hufflepuff", output "loyalty";

  • if it is "slytherin", output "cunning";

  • if it is "ravenclaw", output "intellect";

  • otherwise, output "not a valid house".

Sample Input 1:

gryffindor

Sample Output 1:

bravery
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// start coding here
}
}
___

Create a free account to access the full topic