-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhdStudent.java
More file actions
38 lines (30 loc) · 1.3 KB
/
Copy pathPhdStudent.java
File metadata and controls
38 lines (30 loc) · 1.3 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
import java.util.ArrayList;
public class PhdStudent extends GraduateStudent {
private String advisor, subject;
ArrayList<Lab> labs;
public PhdStudent(String name, String advisor, String subject, String id, ArrayList<Lab> labs) {
super(name, id);
this.labs = labs;
this.advisor = advisor;
this.subject = subject;
}
public void printInvoice() {
System.out.println("VALENCE COLLEGE\nORLANDO FL 10101\n---------------------\n");
System.out.println("Fee Invoice Prepared for Student: \n" + getId() + "-" + getName() + "\n");
System.out.println("RESEARCH\n" + subject + "\t\t\t\t$700.00");
System.out.println("\nHealth & id fees\t\t$35.00");
double total = 735;
if (labs.size() == 2) {
System.out.printf("----------------------------------------\n\t\t\t\t$%.2f\n", total);
System.out.printf("\t\t\t\t-$%.2f\n", total*.50);
System.out.printf("\t\t\t\t-------\n\tTotal Payments\t\t$%.2f\n", total*.50);
} else if (labs.size() >= 3) {
System.out.printf("----------------------------------------\n\t\t\t\t$%.2f\n", total);
System.out.printf("\t\t\t\t-$%.2f\n", 700.00);
total -= 700;
System.out.printf("\t\t\t\t-------\n\tTotal Payments\t\t$%.2f\n", total);
} else {
System.out.printf("----------------------------------------\n\tTotal Payments\t\t$%.2f\n", total);
}
}
}