Date: March 15, 2018
Class: IT 2249
Unit: 10
1 Insert here a copy of your zip file of all of your NetBeans project files so that it could be unzipped,
loaded and run in another NetBeans:
Insert here a copy of your *.java source code text that you used here (copy and paste source code
here, do not simply insert *.java files):
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package u10a1_ooconsoleregisterforcourse;
/**
*
* @author omora
*/
public class Course {
private String code = "";
private int creditHour = 0;
private boolean isRegisterdFor = false;
public Course(String code, int creditHour){
this.code = code;
this.creditHour = creditHour;
}
public void setCode(String code){
this.code = code;
}
public String getCode() {
return this.code;
}
public void setCrditHour(int creditHour) {
this.creditHour = creditHour;
}
, public int getCreditHour() {
return this.creditHour;
}
public void setIsRegisteredFor(boolean trueOrFalse){
this.isRegisterdFor = trueOrFalse;
}
public boolean getIsRegisteredFor() {
return this.isRegisterdFor;
}
}
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package u10a1_ooconsoleregisterforcourse;
import java.util.Scanner;
/**
*
* @author omora
*/
public class U10A1_OOConsoleRegisterForCourse {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Teacher's Copy");
Scanner input = new Scanner(System.in);
//Courses is an array of course objects
//see the Course.java source code for members of Course
Course[] courses = {
new Course("IT1006", 6),
new Course("IT4782", 3),
new Course("IT4789", 3),
new Course("IT4079", 6),
new Course("IT2230", 3),
new Course("IT3345", 3),
new Course("IT2249", 6)