Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mfilipen/43e94c82d0eeea827162dd97e6a795de to your computer and use it in GitHub Desktop.
Save mfilipen/43e94c82d0eeea827162dd97e6a795de to your computer and use it in GitHub Desktop.
IntroductionToProgramming
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectKey">
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/MaksimFilipenkoMS1-4IntroductionToProgrammingAssignment1.iml" filepath="$PROJECT_DIR$/MaksimFilipenkoMS1-4IntroductionToProgrammingAssignment1.iml" />
</modules>
</component>
</project>
<template>
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
</template>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
/**
* Created by User on 31.08.2016.
*/
public class Assistant {
private Mentor assistant;
public Assistant(Mentor assistant) {
this.assistant = assistant;
}
public Mentor getAssistant() {
return assistant;
}
public void setAssistant(Mentor assistant) {
this.assistant = assistant;
}
}
import java.util.Date;
/**
* Created by User on 31.08.2016.
*/
public class Auditorium {
private Integer roomNo;
private Date timeData;
public Auditorium(Integer roomNo, Date timeData) {
this.roomNo = roomNo;
this.timeData = timeData;
}
public Integer getRoomNo() {
return roomNo;
}
public void setRoomNo(Integer roomNo) {
this.roomNo = roomNo;
}
public Date getTimeData() {
return timeData;
}
public void setTimeData(Date timeData) {
this.timeData = timeData;
}
}
/**
* Created by User on 31.08.2016.
*/
public class Grade {
private String grade;
public Grade(String grade) {
this.grade = grade;
}
public String getGrade() {
return grade;
}
public void setGrade(String grade) {
this.grade = grade;
}
}
/**
* Created by User on 31.08.2016.
* we can also add functionlity for onlt instructor. (do grade for students)
*/
public class Instructor {
private Mentor instructor;
public Instructor(Mentor instructor) {
this.instructor = instructor;
}
public Mentor getInstructor() {
return instructor;
}
public void setInstructor(Mentor instructor) {
this.instructor = instructor;
}
}
/**
* Created by User on 31.08.2016.
*/
public class Lecture {
private LectureCourse lecture;
private Auditorium room;
public Lecture(LectureCourse lecture, Auditorium room) {
this.lecture = lecture;
this.room = room;
}
public LectureCourse getLecture() {
return lecture;
}
public void setLecture(LectureCourse lecture) {
this.lecture = lecture;
}
public Auditorium getRoom() {
return room;
}
public void setRoom(Auditorium room) {
this.room = room;
}
}
import java.util.Set;
/**
* Created by User on 31.08.2016.
*/
public class LectureCourse {
private String title;
private Year year;
private Instructor instructor;
private Set<Assistant> assistants;
private boolean isCoreCourse;
public LectureCourse(String title, Year year, Instructor instructor, Set<Assistant> assistants, boolean isCoreCourse) {
this.title = title;
this.year = year;
this.instructor = instructor;
this.assistants = assistants;
this.isCoreCourse = isCoreCourse;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Year getYear() {
return year;
}
public void setYear(Year year) {
this.year = year;
}
public Instructor getInstructor() {
return instructor;
}
public void setInstructor(Instructor instructor) {
this.instructor = instructor;
}
public Set<Assistant> getAssistants() {
return assistants;
}
public void setAssistants(Set<Assistant> assistants) {
this.assistants = assistants;
}
public boolean isCoreCourse() {
return isCoreCourse;
}
public void setCoreCourse(boolean coreCourse) {
isCoreCourse = coreCourse;
}
public void addAssistant(Assistant assistant){
this.assistants.add(assistant);
}
public void removeAssistant(Assistant assistant){
this.assistants.remove(assistant);
}
}
public class Main {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
import java.util.HashSet;
import java.util.Set;
/**
* Created by User on 31.08.2016.
*/
public class Mentor {
private Set <LectureCourse> lectures;
private Person person;
public Mentor(Person person) {
this.lectures = new HashSet<LectureCourse>();
this.person = person;
}
public Mentor(Set<LectureCourse> lectures, Person person) {
this.lectures = lectures;
this.person = person;
}
public Set<LectureCourse> getLectures() {
return lectures;
}
public Person getPerson() {
return person;
}
public void setLectures(Set<LectureCourse> lectures) {
this.lectures = lectures;
}
public void setPerson(Person person) {
this.person = person;
}
public void addLecture(LectureCourse lectureCourse){
this.lectures.add(lectureCourse);
}
public void removeLecture(LectureCourse lectureCourse){
this.lectures.remove(lectureCourse);
}
}
/**
* Created by User on 31.08.2016.
*/
public class Person {
private String firstName;
private String lastName;
public Person(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
import java.util.HashSet;
import java.util.Set;
/**
* Created by User on 31.08.2016.
*/
public class Student {
private Year year;
private Set<LectureCourse> lectureCourses;
private Person person;
public Student(Year year, Person person) {
this.year = year;
this.lectureCourses = new HashSet<LectureCourse>();
this.person = person;
}
public Student(Year year, Set<LectureCourse> lectureCourses, Person person) {
this.year = year;
this.lectureCourses = lectureCourses;
this.person = person;
}
public Year getYear() {
return year;
}
public void setYear(Year year) {
this.year = year;
}
public Set<LectureCourse> getLectureCourses() {
return lectureCourses;
}
public void setLectureCourses(Set<LectureCourse> lectureCourses) {
this.lectureCourses = lectureCourses;
}
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
public void addLectureCourse(LectureCourse lectureCourse){
this.lectureCourses.add(lectureCourse);
}
public void removeLectureCourse(LectureCourse lectureCourse){
this.lectureCourses.remove(lectureCourse);
}
}
import java.util.HashSet;
import java.util.Set;
/**
* Created by User on 31.08.2016.
*/
public class TeachingDay {
private Set<LectureCourse> lectures;
public TeachingDay() {
this.lectures = new HashSet<LectureCourse>();
}
public TeachingDay(Set<LectureCourse> lectures) {
this.lectures = lectures;
}
public Set<LectureCourse> getLectures() {
return lectures;
}
public void setLectures(Set<LectureCourse> lectures) {
this.lectures = lectures;
}
public void addLecture(LectureCourse lecture){
this.lectures.add(lecture);
}
public void removeLecture(LectureCourse lecture){
this.lectures.remove(lecture);
}
}
import java.util.HashSet;
import java.util.Set;
/**
* Created by User on 31.08.2016.
*/
public class TeachingSchedule {
private Set<TeachingWeek> weeks;
public TeachingSchedule() {
this.weeks = new HashSet<TeachingWeek>();
}
public TeachingSchedule(Set<TeachingWeek> weeks) {
this.weeks = weeks;
}
public void addWeek(TeachingWeek week){
this.weeks.add(week);
}
public void removeWeek(TeachingWeek week){
this.weeks.remove(week);
}
}
/**
* Created by User on 31.08.2016.
*/
public class TeachingWeek {
private TeachingDay monday;
private TeachingDay tuesday;
private TeachingDay wednesday;
private TeachingDay thursday;
private TeachingDay friday;
private TeachingDay saturday;
public TeachingWeek(TeachingDay monday, TeachingDay tuesday, TeachingDay wednesday, TeachingDay thursday, TeachingDay friday, TeachingDay saturday) {
this.monday = monday;
this.tuesday = tuesday;
this.wednesday = wednesday;
this.thursday = thursday;
this.friday = friday;
this.saturday = saturday;
}
public TeachingDay getMonday() {
return monday;
}
public void setMonday(TeachingDay monday) {
this.monday = monday;
}
public TeachingDay getTuesday() {
return tuesday;
}
public void setTuesday(TeachingDay tuesday) {
this.tuesday = tuesday;
}
public TeachingDay getWednesday() {
return wednesday;
}
public void setWednesday(TeachingDay wednesday) {
this.wednesday = wednesday;
}
public TeachingDay getThursday() {
return thursday;
}
public void setThursday(TeachingDay thursday) {
this.thursday = thursday;
}
public TeachingDay getFriday() {
return friday;
}
public void setFriday(TeachingDay friday) {
this.friday = friday;
}
public TeachingDay getSaturday() {
return saturday;
}
public void setSaturday(TeachingDay saturday) {
this.saturday = saturday;
}
}
import java.util.HashSet;
import java.util.Set;
/**
* Created by User on 31.08.2016.
*/
public class University {
private Set<Student> students;
private Set<Assistant> assistants;
private Set<Instructor> instructors;
private Set<LectureCourse> course;
private Set<TeachingSchedule> schedule;
public University(){
this.students = new HashSet<Student>();
this.assistants = new HashSet<Assistant>();
this.instructors = new HashSet<Instructor>();
this.course = new HashSet<LectureCourse>();
this.schedule = new HashSet<TeachingSchedule>();
}
public University(Set<Student> students, Set<Assistant> assistants, Set<Instructor> instructors, Set<LectureCourse> course, Set<TeachingSchedule> schedule) {
this.students = students;
this.assistants = assistants;
this.instructors = instructors;
this.course = course;
this.schedule = schedule;
}
public Set<Student> getStudents() {
return students;
}
public void setStudents(Set<Student> students) {
this.students = students;
}
public Set<Assistant> getAssistants() {
return assistants;
}
public void setAssistants(Set<Assistant> assistants) {
this.assistants = assistants;
}
public Set<Instructor> getInstructors() {
return instructors;
}
public void setInstructors(Set<Instructor> instructors) {
this.instructors = instructors;
}
public Set<LectureCourse> getCourse() {
return course;
}
public void setCourse(Set<LectureCourse> course) {
this.course = course;
}
public Set<TeachingSchedule> getSchedule() {
return schedule;
}
public void setSchedule(Set<TeachingSchedule> schedule) {
this.schedule = schedule;
}
public void addStudent(Student student){
this.students.add(student);
}
public void removeStudent(Student student){
this.students.remove(student);
}
public void addAssistant(Assistant assistant){
this.assistants.add(assistant);
}
public void removeAssistant(Assistant assistant){
this.assistants.remove(assistant);
}
public void addInstructor(Instructor instructor){
this.instructors.add(instructor);
}
public void removeInstructor(Instructor instructor){
this.instructors.remove(instructor);
}
public void addLectureCourse(LectureCourse course){
this.course.add(course);
}
public void removeLectureCourse(LectureCourse course){
this.course.remove(course);
}
public void addTeachingSchedule(TeachingSchedule schedule){
this.schedule.add(schedule);
}
public void removeTeachingSchedule(TeachingSchedule schedule){
this.schedule.remove(schedule);
}
}
/**
* Created by User on 31.08.2016.
*/
import java.lang.String;
public class Year {
private String year;
public Year(String year) {
if (validating(year)) {
this.year = year;
} else{
System.out.println("Error!");
}
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
private boolean validating(String string){
return (string.equals("BS1")||string.equals("BS2")||string.equals("BS3")||string.equals("BS4")||string.equals("MS1")||string.equals("MS2"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment