Question: JAVA USING NETBEANS Requirements One class, one file. Don't create multiple classes in the same .java file. Don't use static variables and methods Encapsulation: make

 JAVA USING NETBEANS Requirements One class, one file. Don't create multipleclasses in the same .java file. Don't use static variables and methods

JAVA USING NETBEANS

Requirements

One class, one file. Don't create multiple classes in the same .java file.

Don't use static variables and methods

Encapsulation: make sure you protect your class variables and provide access to them through get and set methods

The Classes and Interfaces:

app Model courseData genEdData course courseName genEd

and 2 interfaces

TableData TableMember

You will use this NetBeans project which has the 7 classes.

app

creates an object of the class Model

Model

Model is a container class. It part of the MVC design pattern that you will learn in the end of the semester in Lesson 07 (L07: MVC: Model, View, Controller). It is here to help you get used to MVC. contains the code to test your implementation of courseData and genEdData. it should be kept as it is, with no changes. It has to work as it is with he remaining classes if the implementation is correct, the result will look like this

Encapsulation: make sure you protect your class variables and provide access to

courseData:

you will edit the courseData class available in the starter package

courseData will have the table (an ArrayList) with courses (objects of the course class)

courseData needs to implement the TableData interface

genEdData:

you will edit the genEdData class available in the starter package

genEdData will have the table (an ArrayList) with gen Eds (objects of the genes class)

genEdData needs to implement the TableData interface

course:

course is the class representing a course

it will implement the TableMember interface

courseName

is an auxiliary class to represent the course name

it is ready to be used and it doesn't need any changes in this assignment.

it overrides toString returning the edited course name as a String.

genEd:

genEd is the class representing a general education requirement

it will implement the TableMember interface

it overrides toString returning the genEd code as a String.

and 2 interfaces

TableData:

it is an interface with suggested methods for a class that will be used in a table display application

its main methods are explained in the interface itself

public void loadTable();
public ArrayList getTable();
public void setSelectedFields(int[ ] selected);
public int[ ] getSelectedFields();
public ArrayList getHeaders();
public ArrayList getLine(int line);
public ArrayList> getLines(int firstLine, int lastLine);

TableMember:

it is an interface with suggested methods for a class that will be used as a member in a table display application.

Classes that will be used as objects in a TableData have to implement TableMember

its main methods are explained in the interface itself

public String getAttribute(int n);
public ArrayList getAttributes();
public String getAttributeName(int n);
public ArrayList getAttributesNames();

Contents TableData TableMember public void loadTable) public ArrayList getTable public intl) getSelectedFields public String getAttribute(int n); public ArrayList String>getAttributes public String getAttributeName int n); app Model model new Model: public ArrayList getLine(int line); public ArrayListgetLines(int firstline, int lastLine) courseData genEdData genEd e String Code; e String Description; course public void ReadCoursesFromXMLO private courseName Name private ArrayListegenEd> GenEds private String Description; private int Credits; private String PreReqs; private String Comments; CreateGenEds) Model courseData cd new courseData) genEdData gd new genEdData( System.out.println("Course Headers"cd.getHeaders) System.out.println("Course line 71"cd.getLine(70).toString)) System.out.println("Course range 10-12-"+cd.getLines(10, 12)); System.out.println(" System.out.println("Gen Ed Headers-"gd.getHeadersl System.out.println("Gen Ed line 4" +gd.getLine(3).toString() System.out.println("Gen Ed range 0-4-+gd.getLines(0, 4)) System.out.println( courseName rivate String major; rivate String number; rivate String complement Contents TableData TableMember public void loadTable) public ArrayList getTable public intl) getSelectedFields public String getAttribute(int n); public ArrayList String>getAttributes public String getAttributeName int n); app Model model new Model: public ArrayList getLine(int line); public ArrayListgetLines(int firstline, int lastLine) courseData genEdData genEd e String Code; e String Description; course public void ReadCoursesFromXMLO private courseName Name private ArrayListegenEd> GenEds private String Description; private int Credits; private String PreReqs; private String Comments; CreateGenEds) Model courseData cd new courseData) genEdData gd new genEdData( System.out.println("Course Headers"cd.getHeaders) System.out.println("Course line 71"cd.getLine(70).toString)) System.out.println("Course range 10-12-"+cd.getLines(10, 12)); System.out.println(" System.out.println("Gen Ed Headers-"gd.getHeadersl System.out.println("Gen Ed line 4" +gd.getLine(3).toString() System.out.println("Gen Ed range 0-4-+gd.getLines(0, 4)) System.out.println( courseName rivate String major; rivate String number; rivate String complement

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!