1. Create the following classes based on the given declaration. Also, each class
ID: 3594051 • Letter: 1
Question
1. Create the following classes based on the given declaration. Also, each class should have the default constructor. Just place the prototypes of the construction in the class but you don’t have to implement them. The default constructor is a public member.
CSUSM is an object of class University. Class University has the fallowing private attributes
- UnivName: string
- UnivDepts: a vector of Department class
- UnivStudents: a vector of Student class
- UnivAdress: string
- UnivAge: int
Each department has the fallowing private attributes
- deptName: string
- deptFacility: vector of Facility class
- deptYearCreated: int
Each student has the fallowing attributes.
- studName : string
- studYearOfStudy: int
- studNumber: long
- studCoursesTaken: vector of course class
Each facility has the fallowing private attributes
- FacName: string
- FacYearExperience : int
- FacId: long
- FacCoursesTeaches : vector of Course class
Each course has the fallowing private attributes
- courseTitle : string
- courseNumber : float
- courseNumberOfCredits: int
Explanation / Answer
package education;
import java.util.Vector;
public class University {
private String UnivName;
private Vector<Department> UnivDepts;
private Vector<Student> UnivStudents;
private String UnivAddress;
public University(){
}
public static void main(String[] args) {
University CSUSM=new University();
}
}
class Department{
private String deptname;
private Vector<Facility> deptFacility;
private int deptYearCreated;
public Department(){
}
}
class Student{
private String studName;
private int yearOfStudy;
private long studNumber;
private Vector<Course> studCoursesTaken;
public Student(){
}
}
class Facility{
private String facName;
private int facYearExperience;
private long facId;
private Vector<Course> facCoursesTeaches;
public Facility() {
}
}
class Course{
private String courseTitle;
private float courseNumber;
private int courseNoOfCredits;
public Course() {
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.