/** * * @param department * @param courseNumber * @param courseCredits */ public Course(String department, int courseNumber, int courseCredits) { this.department = department; this.courseNumber = courseNumber; this.courseCredits = courseCredits; courseCost = courseCredits / 2 * 500; }
public String getDepartment() { return department; }
public void setDepartment(String department) { this.department = department; }
public XXX getCourseNumber() { return courseNumber; }
XXXXXX void setCourseNumber(XXX XXXXXXXXXXXX) { this.courseNumber = courseNumber; }
XXXXXX XXX XXXXXXXXXXXXXXXX() { return courseCredits; }
public void XXXXXXXXXXXXXXXX(XXX courseCredits) { this.XXXXXXXXXXXXX = XXXXXXXXXXXXX; }
XXXXXX double getCourseCost() { XXXXXX courseCost; }
public void XXXXXXXXXXXXX(double courseCost) { this.courseCost = XXXXXXXXXX; }
@Override public XXX XXXXXXXX() { XXX XXXX = X; XXXX = 89 * XXXX + Objects.hashCode(this.department); hash = XX * hash + this.XXXXXXXXXXXX; XXXX = XX * XXXX + XXXX.courseCredits; hash = 89 * hash + (XXX) (XXXXXX.XXXXXXXXXXXXXXXX(XXXX.courseCost) ^ (XXXXXX.doubleToLongBits(XXXX.courseCost) &XX;>&XX; 32)); return hash; }
@XXXXXXXX XXXXXX boolean XXXXXX(XXXXXX obj) { XX (this == obj) { return true; } if (obj == XXXX) { XXXXXX XXXXX; } if (getClass() != XXX.XXXXXXXX()) { XXXXXX XXXXX; } XXXXX XXXXXX other = (XXXXXX) XXX; XX (this.XXXXXXXXXXXX != XXXXX.XXXXXXXXXXXX) { XXXXXX XXXXX; } if (this.XXXXXXXXXXXXX != XXXXX.courseCredits) { return false; } if (XXXXXX.XXXXXXXXXXXXXXXX(XXXX.XXXXXXXXXX) != XXXXXX.XXXXXXXXXXXXXXXX(other.courseCost)) { return false; } if (!Objects.equals(this.XXXXXXXXXX, XXXXX.department)) { XXXXXX false; } return true; }
@XXXXXXXX XXXXXX String XXXXXXXX() { return "XXXXXX{" + "department=" + XXXXXXXXXX + ", courseNumber=" + XXXXXXXXXXXX + ", XXXXXXXXXXXXX=" + XXXXXXXXXXXXX + ", courseCost=" + XXXXXXXXXX + '}'; }
}
XXXXX:-
XXXXXXX XXX.in.CheggApps;
/** * * @author DELL */ XXXXXX XXXXX XXXXXXXXX extends XXXXXX {
XXXXXXXXX(XXXXXX department, int XXXXXXXXXXXX, XXX courseCredits) { super.XXXXXXXXXXXXX((XXXXXXXXXXXXX / 2 * XXX) + XXX); }
@XXXXXXXX XXXXXX String toString() { XXXXXX XXXXX.XXXXXXXX(); //XX change body XX XXXXXXXXX XXXXXXX, choose Tools | XXXXXXXXX. }
@Override XXXXXX boolean XXXXXX(Object obj) { XXXXXX super.equals(obj); //XX change body XX XXXXXXXXX methods, choose Tools | Templates. }
@XXXXXXXX XXXXXX XXX XXXXXXXX() { return XXXXX.hashCode(); //To change body of XXXXXXXXX XXXXXXX, choose Tools | Templates. }
@XXXXXXXX public void setCourseCost(XXXXXX courseCost) { super.XXXXXXXXXXXXX(XXXXXXXXXX); //XX change body of XXXXXXXXX XXXXXXX, XXXXXX XXXXX | Templates. }
@Override XXXXXX XXXXXX getCourseCost() { return XXXXX.XXXXXXXXXXXXX(); //To change body XX XXXXXXXXX XXXXXXX, XXXXXX Tools | XXXXXXXXX. }
@Override XXXXXX XXXX setCourseCredits(XXX courseCredits) { XXXXX.setCourseCredits(XXXXXXXXXXXXX); //To change body XX XXXXXXXXX XXXXXXX, XXXXXX XXXXX | XXXXXXXXX. }
@XXXXXXXX XXXXXX int XXXXXXXXXXXXXXXX() { return super.getCourseCredits(); //XX XXXXXX body of XXXXXXXXX XXXXXXX, XXXXXX XXXXX | Templates. }
@Override public void XXXXXXXXXXXXXXX(XXX XXXXXXXXXXXX) { super.setCourseNumber(XXXXXXXXXXXX); //XX change body of generated XXXXXXX, choose XXXXX | Templates. }
@Override XXXXXX int getCourseNumber() { XXXXXX XXXXX.XXXXXXXXXXXXXXX(); //To XXXXXX body XX XXXXXXXXX XXXXXXX, XXXXXX XXXXX | XXXXXXXXX. }
@Override XXXXXX void setDepartment(XXXXXX XXXXXXXXXX) { XXXXX.XXXXXXXXXXXXX(XXXXXXXXXX); //To change body XX XXXXXXXXX XXXXXXX, choose XXXXX | XXXXXXXXX. }
@Override XXXXXX String getDepartment() { XXXXXX super.XXXXXXXXXXXXX(); //XX change body of XXXXXXXXX methods, choose XXXXX | XXXXXXXXX. }
Part3:-
package XXX.in.CheggApps;
XXXXXX java.XXXX.Arrays; import java.XXXX.XXXXXXX;
/** * * @XXXXXX DELL */ public XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX {
/** * * @param args */ public XXXXXX XXXX XXXX(XXXXXX[] args) { String XXXXXXXXXX; int courseNumber, XXXXXXXXXXXXX; Scanner XXXXXXX = new Scanner(System.in); XXX noOfCourses; XXXXXX.err.println("***** Welcome XX The XXXXXXX of Winston and Charlotte *****"); System.out.XXXXXXX("XXXXXX XXXXX how many courses u XXXX to XXXX?"); noOfCourses = scanner.nextInt(); XXXXXX[] XXXXXXX = new Course[noOfCourses]; for (XXX i = 0; i &XX; noOfCourses; i++) {
XXXXXX.out.println("XXXXXX enter department " + i + " details:"); department = XXXXXXX.XXXX(); if (XXXXXXXXXX.equals("COMP") || department.equals("XXXX") || department.XXXXXX("XXXX")) { XXXXXX.err.println("XXXXXXXXX selectedd..."); System.out.println("XXXXXX XXXXX XXXXXX number: "); XXXXXXXXXXXX = XXXXXXX.XXXXXXX(); System.out.println("please XXXXX course courseCredits: "); courseCredits = scanner.nextInt(); //XXXXXX[] labcourse = XXX XXXXXXXXX[XXXXXXXXXXX]; courses[i] = XXX LabCourse(XXXXXXXXXX, courseNumber, XXXXXXXXXXXXX);// Allocating XXXXXX to each object XXXXXXX[i].XXXXXXXXXXXXX(XXXXXXXXXX); courses[i].setCourseNumber(courseNumber); courses[i].setCourseCredits(courseCredits);
} XXXX { System.out.println("XXXXXX enter XXXXXX XXXXXX: "); courseNumber = scanner.nextInt(); XXXXXX.out.println("please enter XXXXXX courseCredits: "); courseCredits = scanner.XXXXXXX(); courses[i] = new Course(XXXXXXXXXX, XXXXXXXXXXXX, XXXXXXXXXXXXX);// Allocating memory to XXXX XXXXXX courses[i].XXXXXXXXXXXXX(department); courses[i].XXXXXXXXXXXXXXX(courseNumber); XXXXXXX[i].XXXXXXXXXXXXXXXX(XXXXXXXXXXXXX); } } System.XXX.println("Total XXXXXXX...."); System.out.println(Arrays.toString(courses)); XXXXXX.out.println("XXXXXXXXXX\tcourseNumber\XXXXXXXXXXXXXX\XXXXXXXXXXX"); for (int i = 0; i &XX; noOfCourses; i++) { XXXXXX.out.println(courses[i].XXXXXXXXXXXXX() + "\t\t\t" + XXXXXXX[i].getCourseNumber() + "\t" + courses[i].getCourseCredits() + "\t" + courses[i].XXXXXXXXXXXXX()); }
} }
XXXXXX XXXXXX:-
================
XXX: XXXXXX XXXXX how many courses u want XX XXXX? ***** Welcome to XXX XXXXXXX XX XXXXXXX and Charlotte ***** X please XXXXX XXXXXXXXXX 0 XXXXXXX: XXXXXX XXXXXX enter XXXXXX number: 32 please XXXXX XXXXXX XXXXXXXXXXXXX: XX XXXXXX enter XXXXXXXXXX X XXXXXXX: PHYS XXXXXX XXXXX course number: 32 please enter course XXXXXXXXXXXXX: XX please XXXXX department X XXXXXXX: XXXXX XXXXXX XXXXX XXXXXX number: XX please XXXXX XXXXXX courseCredits: 32 XXXXX XXXXXXX.... [XXXXXX{XXXXXXXXXX=XXXXXX, XXXXXXXXXXXX=XX, XXXXXXXXXXXXX=32, courseCost=8000.0}, XXXXXX{department=XXXX, XXXXXXXXXXXX=XX, XXXXXXXXXXXXX=32, XXXXXXXXXX=XXXX.0}, XXXXXX{department=XXXXX, XXXXXXXXXXXX=32, XXXXXXXXXXXXX=32, XXXXXXXXXX=XXXX.X}] XXXXXXXXXX XXXXXXXXXXXX courseCredits XXXXXXXXXX Scince 32 XX 8000.X PHYS XX 32 8100.X XXXXX XX XX XXXX.0