academic program class java 1
The AcademicProgram Class
The AcademicProgram class is what is called a super class.
- The attributes (use encapsulation)
- String name;
- int minimumNumberOfCredits;
- ArrayList<Course> requiredCourses;
- two constructors
- one complete with all parameters, one for each attribute
- one with no parameters
- the default values should be
- name – blank String (no spaces)
- minimumNumberOfCredits – 0
- requiredCourses – a new ArrayList<Course>
- the default values should be
- a toString() method that will display information about the object
- you can use the Netbeans automatic builder format
- The “get/set” methods
- no special requirements.
The app Class
Create and display an AcademicProgram object with 3 courses (see below).
name: “Special Studies in Cyber Security”
minimumNumberOfCredits: 9
courses: 3 Course objects
- using the default/no parameter constructor
- using these values
- name – “Cyber”, “100”, “h”
- genEd – “IL” (the GenEd object returned with the find method in GenEdData)
- description – “Computer Systems Literacy”
- credits_min_per_course – 3
- credits_max_per_course – 9
- credits_maximum – 99
- preReq – use the default constructor for CourseName
-
- name – “CYBER”, “262”, “”
- genEd – “GS” (the GenEd object returned with the find method in GenEdData)
- description – “Cyber-Defense Studio”
- credits_min_per_course – 3
- credits_max_per_course – 9
- credits_maximum – 99
- preReq – “Cyber”, “100”, “”
Displaying
- display the name and minimumNumberOfCredits
- display each course in a single line
- use the special string sequence “n” to add a new line to the display
Below a sample output (including part of the necessary code in app)