Java programming 2 | Information Systems homework help

Task 1

For this task you will create a Subject class, whose instances will represent the subjects for study at a university. A subject will have a name, just a String, and a subject code, which is a six-character String. The first three characters of a subject code are alphabetic and the last three are numeric. The first three characters define the subject’s discipline area. A subject code must be unique.

You will also write a TestSubject class to test the use of your Subject class. In particular this will maintain an array of subjects. In order to manage the uniqueness of the subject codes, your program will need to display information about existing subject codes as well as checking that any new subject code supplied by the user is not the same as any existing subject code.

The following state and functionality should be provided for the Subject class:

  • Two fields will hold the subject’s name and the six-character subject code.
  • A constructor will allow a name and a new, validated subject code to be provided when a new subject is created.
  • Getters will provide access to the attributes.
  • An accessor method called getDiscipline will return a string containing the first three characters of the subject code.
  • Another accessor method called codeMatches will return a boolean value indicating if the subject’s code matches the string argument provided. “Matches” is used here in the same sense as for the matches method of the String class.
  • toString method will return a string containing the subject code and subject name.

To assist with managing subject codes and their uniqueness you will provide the Subject class with some class methods as follows:

  • An allDisciplines method will accept an array of Subject objects. It will return an array containing the different 3-character discipline codes represented in the array of subjects in alphabetically order. 
  • codesPerDiscipline method will accept an array of Subject objects and a 3-character discipline code. It will return an array containing the different subject codes represented in the array of subjects for the particular discipline.
  • An isValidCode method will accept a string that is a possible new subject code, and return a boolean indicating whether it satisfies the structural requirements for a subject code.
  • codeExists method will accept an array of Subject objects and a possible new subject code. It will return a boolean indicating whether that code has already been allocated to one of the subjects in the array.
  • sortDisciplines method will accept an array of Subjects objects. It will return the sorted array of subjects in alphabetically order.  

Your TestSubject program will perform the following sequence of actions, using good design techniques such as in the appropriate use of methods:

  • An initial array of Subject objects will be created from any data in a file that was previously saved by the program.
  • The user interaction will then proceed to allow the user to add one or more new subjects to the array. If the user wishes to add new subjects, the discipline areas of existing subjects should be displayed in alphabetically order. The user will then enter a discipline code to which the program will respond by displaying any existing subject codes in that discipline. This procedure simplifies the user’s task of choosing subject codes that do not already exist, but does not prevent user mistake. Each subject code entered by the user should be checked. The user can enter any new subjects in that discipline (or indeed in other disciplines). The user should be given the choice of repeating the processing for other discipline areas.
  • When the user has finished adding subjects, and only if subjects have indeed been added, the program will overwrite the data file with the updated data.

Note:

  • You may use an ArrayList to implement an array if you prefer and it is appropriate.

 

Material to submit

The material to submit for each task is described in the section Assessment Information in this Subject Outline, under the heading Presentation.

 

Task 2

Develop a set of classes for a college to use in various student service and personnel applications. Classes you need to design include following:

 

  • Person: A Person contains a first name, last name, street address, zip code, and phone number. The class also includes a method that sets each data field and display method that displays all of a Person’s information.
  • CollegeEmployee: CollegeEmployee descends from Person. A CollegeEmployee also includes a Social Security number, an annual salary, and a department name, as well as methods that override the Person methods to accept and display all collegeEmployee data.
  • Faculty: Faculty descends from ColegeEmployee. This class also includes a Boolean field that indicates whether the Faculty member is permanent, as well as methods that override the CollegeEmployee methods to accept and display this additional piece of information.
  • Student: Student descends from Person. In addition to the fields available in Person, a Student contains a major field of study and a grade point average as well as methods that override the Person methods to accept and display these additional facts.

Write a test Java program named CollegeList that declares an array of four “regular” CollegeEmployees, three Faculty, and seven Students. Prompt the user to specify which type of person’s data will be entered (‘C’, ‘F’, or ‘S’ indicates CollegeEmployee, Faculty, and Student respectively) or allow the user to quit (‘Q’). While the user choose to continue (that is, does not quit), accept data entry for the appropriate type of Person. If the user attempts to enter data for more than four CollegeEmployees, three Faculty, or seven Students, display an error message. When the user quits, display a report on the screen listing each group of Persons under the appropriate heading “College Employees,” “Faculty,” or “Students.” If the user has not entered data for one or more types of Persons during a session, display an appropriate message under the appropriate heading.

 

Save the files as Person.javaCollegeEmployee.javaFaculty.java, and Student.java, and CollegeList.java.  







Calculate Your Essay Price
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 10% with the coupon code: best10