-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFYP.java
More file actions
81 lines (70 loc) · 2.67 KB
/
Copy pathFYP.java
File metadata and controls
81 lines (70 loc) · 2.67 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
import java.util.*;
import java. util.Scanner;
public class FYP {
private String projectTitle;
private String studentName;
private String studentID;
private String supervisor; //supervisor name
private String field; //Computer Science,Networking,Netcentric
public FYP(String a, String b, String c, String d, String e){
projectTitle = a;
studentName = b;
studentID = c;
supervisor = d;
field = e;
}
public String getTitle() {return projectTitle;}
public String getStudentName() {return studentName;}
public String getStudentID() {return studentID;}
public String getSupervisor() {return supervisor;}
public String getField() {return field;}
public String toString() {
return "\nProject title: "+projectTitle+"\nSupervisor: "+supervisor;
}
public static void main(String[] args) {
Stack <FYP> fypStack = new Stack<>();
Stack <FYP> networkingStack = new Stack<>();
Stack <FYP> holdStack = new Stack<>();
Scanner sc = new Scanner(System.in);
String projectTitle;
String studentName;
String studentID;
String supervisor;
String field;
int networkCount=0;
for(int i=0; i<20; i++){
System.out.println("\nProject title: ");
projectTitle=sc.nextLine();
System.out.println("Student Name: ");
studentName = sc.nextLine();
System.out.println("Student ID: ");
studentID=sc.nextLine();
System.out.println("Supervisor: ");
supervisor=sc.nextLine();
System.out.println("Field: ");
field=sc.nextLine();
FYP f = new FYP(projectTitle, studentName, studentID, supervisor, field);
fypStack.push(f);
}
while(!fypStack.isEmpty()){
FYP f = fypStack.pop();
if(f.getField().equalsIgnoreCase("Networking")){
networkingStack.push(f);
networkCount++;
}
holdStack.push(f);
}
System.out.println("\nTotal number of networking Final Year Projects :"+networkCount);
while(!holdStack.isEmpty()) {
FYP f = holdStack.pop();
fypStack.push(f);
}
System.out.println("\n----------List of networking Final Year Projects----------");
while(!networkingStack.isEmpty()){
FYP f = networkingStack.pop();
if(f.getSupervisor().startsWith("Dr"))
System.out.println(f.toString());
}
sc.close();
}
}