/******************************* * Name: Huy Nguyen * * Lab #5 * * Fall 1998, ICS 52 * ********************************/ // ICSRequirement.java -- ICS 52 homework #5 -- Fall, 1998 import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; import SAO.*; public class ICSRequirement { private Vector requireList; private Vector projectList; String[][] intemediate = {{"102", "122", "123"}, {"132"}, {"142", "143", "144", "148"}, {"152", "153"}, {"162", "163", "164"}, {"172", "173"}}; String[][] math = {{"105A","105B","107"}, {"120A","120B","121A","121B","123"}, {"130A","130B","130C","131A","131B","131C","132A","132B","132C"}, {"114A","140A","140B","140C","140D","146","147"}, {"162A","161B"}, {"171A","171B","171C"}}; private float minGPA; private SAOCourseList courseList; public ICSRequirement( SAOCourseList courseList) { this.courseList = courseList; requireList = new Vector(20,10); projectList = new Vector(20,10); float minGPA = 2.0f; String[] requireICS= {"21","22","23","51","52","6A","121","131","141","151","161","171"}; addListedCourse("ICS", requireICS, requireList); String[] requireMath = {"6A","6B","6C", "3A","2A","2B","2"}; addListedCourse("Math", requireMath, requireList); String[] project = {"125", "126","105", "135","145A", "145B","155A", "155B", "156","165","175A", "175B" }; addListedCourse("ICS", project, projectList ); } void addListedCourse( String dept, String[] num, Vector list ) { for(int i=0; i= 3 && total<3) { str2 = new String("Project courses are repeated from the same area. Please verify"); v.addElement(str2); } Enumeration e = v.elements(); return e; } public String metUDMath(StudentSchedule schedule) { int count = 0; int group = 0; boolean index[] ={false,false,false,false,false,false}; //6 groups of intemediate; for( int i=0; i < 6; i++ ) for( int j=0; j < math[i].length; j++ ) { CourseId id = new CourseId( "Math", math[i][j] ); if( schedule.isInSchedule(id) ) { count++; index[i] = true; } } for(int k=0; k < 6; k++ ) if(index[k]==true) group++; String temp = new String(""); if( count == 0 ) temp = temp + "No course in your schedule satisfyies upper division math requirement."; else if ( count < 3 ) temp = temp + "Only "+count+" course(s) satisfy UD math requirement in your schedule."; else if ( group < 2 ) temp = temp + "Your upper division math courses are all in the same group."; else temp = temp + "There are " + count + " math courses in " + group + " groups."; return temp; } public boolean metGPA(StudentSchedule schedule) { return (schedule.getOverallGPA() > minGPA); } public void Debug(String mesg) { System.out.println(mesg); return; } }