/******************************* * Name: Huy Nguyen * * Lab #5 * * Fall 1998, ICS 52 * ********************************/ // Specialization.java -- ICS 52 homework #5 -- Fall, 1998 import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; import java.lang.Object; import SAO.*; public class Specialization { private String name; public Specialization( String name ) { this.name = name; } public String groupCheck(int req, String[] list,StudentSchedule schedule) { String temp = new String(""); int count = 0; for(int i=0; i= req ? (new String ("MET")) : (new String( (req-count)+ "from " + temp)); } public String getName() { return name; } } class Artificial extends Specialization { public Artificial() { super("Artificial Intelligence"); } String[][] list={{"163","165"}, {"172","173","175A","175B"}}; public Enumeration getSpecCourseList() { Vector v = new Vector(2); v.addElement( new String("one course from ICS 163 or 165")); v.addElement( new String("three courses from ICS 172, 173, 175A,175B")); return v.elements(); } public Enumeration specCheck(StudentSchedule schedule) { Vector v = new Vector(2); v.addElement( groupCheck(1,list[0],schedule) ); v.addElement( groupCheck(3,list[1],schedule) ); return v.elements(); } } class Sys extends Specialization { public Sys() { super("Computer Systems"); } String[] list={"123","144","145A","145B","148"}; public Enumeration getSpecCourseList() { Vector v = new Vector(1); v.addElement( new String("four courses from ICS 123, 144, 145A, 145B,148")); return v.elements(); } public Enumeration specCheck(StudentSchedule schedule) { Vector v = new Vector(1); v.addElement( groupCheck(4,list,schedule) ); return v.elements(); } } class Algorithm extends Specialization { public Algorithm() { super("Implementation and Analysis of Algorithm"); } String[][] list={{"163","164","165"}, {"125","145A","145B","156","175A","175B"}}; public Enumeration getSpecCourseList() { Vector v = new Vector(2); v.addElement( new String("two courses from ICS 163, 164, 165")); v.addElement( new String("two courses from ICS 125, 145A, 145B, 156, 175A, 175B")); return v.elements(); } public Enumeration specCheck(StudentSchedule schedule) { Vector v = new Vector(2); v.addElement( groupCheck(2,list[0],schedule) ); v.addElement( groupCheck(2,list[1],schedule) ); return v.elements(); } } class Information extends Specialization { public Information() { super("Information Systems"); } String[][] list={{"102","105","125","132","135"}, {"123","137","153","175B","184"}}; public Enumeration getSpecCourseList() { Vector v = new Vector(2); v.addElement( new String("three courses from ICS 102, 105, 125, 132, 135")); v.addElement( new String("one course from ICS 123, 137, 153, 175B, 184")); return v.elements(); } public Enumeration specCheck(StudentSchedule schedule) { Vector v = new Vector(2); v.addElement( groupCheck(3,list[0],schedule) ); v.addElement( groupCheck(1,list[1],schedule) ); return v.elements(); } } class Network extends Specialization { public Network() { super("Networks and Distributed Systems"); } String[] list={"123","145B","148","153","156"}; public Enumeration getSpecCourseList() { Vector v = new Vector(1); v.addElement( new String("four courses from ICS 123, 145B, 148, 153, 156")); return v.elements(); } public Enumeration specCheck(StudentSchedule schedule) { Vector v = new Vector(1); v.addElement( groupCheck(4,list,schedule) ); return v.elements(); } } class Software extends Specialization { public Software() { super("Software Systems"); } String[][] list={{"102","105","122","123"}, {"125","127"}, {"126A","126B"}}; public Enumeration getSpecCourseList() { Vector v = new Vector(3); v.addElement( new String("two courses from ICS 102, 105, 122, 123")); v.addElement( new String("EITHER two courses from ICS 125, 127 OR ")); v.addElement( new String("OR two courses from 126A, 126B")); return v.elements(); } public Enumeration specCheck(StudentSchedule schedule) { Vector v = new Vector(2); v.addElement( groupCheck(2,list[0],schedule) ); v.addElement( new String("EITHER " + groupCheck(2,list[1],schedule) ) ); v.addElement( new String("OR " + groupCheck(2,list[2], schedule))); return v.elements(); } }