-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhoop.java
More file actions
97 lines (88 loc) · 3.29 KB
/
Copy pathhoop.java
File metadata and controls
97 lines (88 loc) · 3.29 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* The hoop class can be used as a model for your own class that represents you and your seating location in AP CSA
*
* @author Mr. Kaehms
* @version 2.0 Aug 13, 2019
* @version 3.0 July 21, 2020
*/
public class hoop extends Student implements SpecialInterestOrHobby
{
/**
* Constructor for the hoop class.
* Constructors are special methods with the same exact name as the class name.
* Constructors to not have return types.
* Constructors can be overloaded. This means we can call a constructor with different sets of parameter
* lists to initalize for different conditions (depending on what constructors have been written.
* @param String f (firstname)
* @param String l (lastname)
* @param int r (row of seating arrangement)
* @param int s (seat number within row seating arrangement)
*
*/
public hoop(String f, String l, int r, int s) {
firstName=f;
lastName=l;
myRow=r;
mySeat=s;
portraitFile="hoop.jpg"; // Make sure to name your image files firstlast.jpg, all lowercase!!!
setImage(portraitFile);
sitting=true;
}
/**
* Default constructor, if you don't pass in a name and seating location
* Pay attention to how the row and seat variables set the location of the image. 1,1 is the first cell in the upper left
* of the classroom.
*/
public hoop() {
firstName="Basket";
lastName="Hoop";
myRow=1;
mySeat=3;
// imgFile=firstName.toLowerCase()+ lastName.toLowerCase()+".jpg";
portraitFile="hoop.jpg";
setImage(portraitFile);
sitting=true;
}
/**
* Act - do whatever the hoop actor wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
//nothing
}
/**
* Prints the first and last name to the console
*/
public void getName(){
//not needed
}
/**
* This method needs to allow the user to interact with the student through a question and answer interface, and provide
* some mechanism that allows the student to sit down once the Q&A session ends. You can use this basic model, or come up
* with some additional class and object that represents a blackboard, or a talking cartoon bubble etc. If you provide extra
* classes, make sure to fully document so other students can use the same interface.
*/
public void provideLesson(){
//not needed
}
public void answerQuestion(){
// may not need
}
/**
* This is a local method specific to the hoop class used to animate the character once the image is clicked on.
* You should write your own methods to perform your own animation for your character/avatar.
*/
public void bounce(){
//nothing
}
/**
* myHobby is one of the interfaces provided.
* An interface is just a contract for the methods that you will implement in your code. The College Board no longer
* tests on abstract classes and interfaces, but it is good to know about them
*/
public void myHobby(String s) {
//not needed
}
}