-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLongbottom.java
More file actions
27 lines (24 loc) · 863 Bytes
/
Longbottom.java
File metadata and controls
27 lines (24 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class Longbottom implements MagicWand{
private int housePoints = 0;
public void expectoPatronum(){
System.out.println("Nothing happens.");
}
public void wingardiumLeviosa(){
System.out.println("Feather wiggles a little.");
System.out.println( "\"More practice is needed, lose 5 points.\"");
changeHousePoints(-5);
}
public void protego(){
System.out.println("An unusually strong forcefield appears");
System.out.println("\"Excellent job! Longbottom earns 10 points\"");
changeHousePoints(10);
}
public void expelliarmus(){
System.out.println("Nothing happens.");
System.out.println( "\"More practice is needed, lose 5 points.\"");
changeHousePoints(-5);
}
private void changeHousePoints(int num){
housePoints += num;
}
}