-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPresenter.java
More file actions
30 lines (20 loc) · 838 Bytes
/
Presenter.java
File metadata and controls
30 lines (20 loc) · 838 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
28
29
30
public class Presenter{
//Class atributes
String name, affilation;
int presentationFee;
//THE MAX NUMBER OF PRESENTATIONS ALLOWED TO BE PRESENTED BY ANY ONE PRESENTER //
static final int MAX_NUMBER_PRESENTATIONS = 10;
int noOfPresentations =0;
//An atribute which holds all the instances of the presentation class
Presentation [] presentations = new Presentation [MAX_NUMBER_PRESENTATIONS];
public void presentationSighnUp(Presentation presentation){
try{//Try to add a presentation to the presentations array
presentations[noOfPresentations++] = presentation;
}catch ( ArrayIndexOutOfBoundsException e){
System.out.println("Too many presentations for one presenter");
}
}
public void printDetails(){
System.out.println("Name : " +name+", Affiliation : " +affilation +" Presenter Fee: £"+presentationFee+".00");
}
}