-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFA.java
More file actions
43 lines (35 loc) · 1.49 KB
/
Copy pathFA.java
File metadata and controls
43 lines (35 loc) · 1.49 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
/*import java.util.Stack;
public class FA {
public static void main(String[] args) {
Stack vacStack = new Stack<>();
Stack tempStack = new Stack<>();
Stack pfStack = new Stack();
while(!vacStack.isEmpty()){
Vaccine temp = (Vaccine) tempStack.pop();
if(temp.getVacNo().equalsIgnoreCase("007")&&temp.getVacType().equalsIgnoreCase("AstraZeneca")){
temp.setVacPrice(1999.0);
}
System.out.println("Vaccine info : \nVaccine Number= " + temp.getVacNo() + "\nVaccine Price= RM" + temp.getVacPrice() + " \nVaccine Year=" + temp.getVacYear() + " \nVaccineType= " + temp.getVacType);
}
if(temp.getCategory() == 1) {
if(temp.getAmount()<lowestAsnaf)
lowestAsnaf=temp.getAmount();
if(temp.getAmount()>highestAsnaf)
highestAsnaf=temp.getAmount();
}
if(temp.getCategory() == 2) {
if(temp.getAmount()<lowestPoor)
lowestPoor=temp.getAmount();
if(temp.getAmount()>highestPoor)
highestPoor=temp.getAmount();
} System.out.println("\nHighest Asnaf : RM"+highestAsnaf);
System.out.println("\nLowest Asnaf : RM"+lowestAsnaf);
System.out.println("\nHighest Poor : RM"+highestPoor);
System.out.println("\nLowest Poor : RM"+lowestPoor);
while(!tempStack.isEmpty()){
Vaccine temp = (Vaccine) tempStack.pop();
vacStack.push(temp);
}
}
}
*/