Commit a0763f47 authored by Ali Shakoori's avatar Ali Shakoori

ramadan is here

parents
Pipeline #588 failed with stages
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Lam9.iml" filepath="$PROJECT_DIR$/Lam9.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?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>
\ No newline at end of file
This diff is collapsed.
<?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="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
package org.university.core;
import java.util.ArrayList;
public abstract class AbstractEmployee extends Person implements AccountingInterface
{
protected ArrayList<Statement> bankStatments = new ArrayList<Statement>();
protected String position;
protected double basicIncome,currentIncome;
public AbstractEmployee(String firstName, String lastName, String ID, int joiningYear, Department department, String position, double basicIncome) {
super(firstName, lastName, ID, joiningYear, department);
this.position = position;
this.basicIncome = basicIncome;
}
public abstract boolean isPromotable();
public void addBankStatement(Statement s)
{
bankStatments.add(s);
}
@Override
public AbstractEmployee callEmployee() {
return this;
}
@Override
public double callCurrentIncome() {
return callCurrentIncome();
}
public ArrayList<Statement> getBankStatments() {
return bankStatments;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public double getBasicIncome() {
return basicIncome;
}
public void setBasicIncome(double basicIncome) {
this.basicIncome = basicIncome;
}
public void setCurrentIncome(double currentIncome)
{
this.currentIncome = currentIncome;
}
public double calCurrentIncome()
{
return currentIncome;
}
}
package org.university.core;
public class Account {
private AbstractEmployee owner;
private double credit;
public Account(AbstractEmployee owner , double credit){
this.credit = credit;
this.owner = owner;
}
public AbstractEmployee getOwner() {
return owner;
}
public double getCredit() {
return credit;
}
public void setCredit(double credit) {
this.credit = credit;
}
public void setOwner(AbstractEmployee owner) {
this.owner = owner;
}
}
package org.university.core;
public interface AccountingInterface {
public AbstractEmployee callEmployee();
public double callCurrentIncome();
}
package org.university.core;
import java.util.ArrayList;
public class AccountingManagement
{
private ArrayList<Account> accounts;
private ArrayList<Statement> statements;
public void checkout(AccountingInterface employee)
{
boolean flag = true;
for (Account account:accounts)
{
if (account.getOwner()==employee)
{
double amount = employee.callCurrentIncome();
account.setCredit(account.getCredit()+amount);
flag = false;
Statement s = new Statement(amount,employee.callEmployee());
statements.add(s);
}
}
if (flag)
{
double amount = employee.callCurrentIncome();
Account ac = new Account(employee.callEmployee(),employee.callCurrentIncome());
accounts.add(ac);
Statement s = new Statement(amount,employee.callEmployee());
statements.add(s);
}
}
}
package org.university.core;
import java.util.ArrayList;
public class Course {
private String name;
private Professor instructor;
private ArrayList<Student> students = new ArrayList<Student>();
private GraduateStudent teacherAssistance;
public GraduateStudent getTeacherAssistance() {
return teacherAssistance;
}
public void setTeacherAssistance(GraduateStudent teacherAssistance) {
this.teacherAssistance = teacherAssistance;
}
public Course(String name, Professor instructor) {
this.name = name;
this.instructor = instructor;
}
public String getName() {
return name;
}
public Professor getInstructor() {
return instructor;
}
public ArrayList<Student> getStudents() {
return students;
}
public void addStudent(Student student){
this.students.add(student);
}
}
package org.university.core;
import java.util.ArrayList;
public class Department {
private String name;
private ArrayList<Course> courses = new ArrayList<>();
public Department(String name) {
this.name = name;
}
public String getName() {
return name;
}
public ArrayList<Course> getCourses() {
return courses;
}
public void addCourse(Course course) {
courses.add(course);
}
}
\ No newline at end of file
package org.university.core;
import java.util.ArrayList;
public class GraduateStudent extends Student
{
private ArrayList<Publication> publications;
private Professor advisor;
public GraduateStudent(String firstName, String lastName, String ID, int joiningYear, Department department, Professor advisor) {
super(firstName, lastName, ID, joiningYear, department);
this.advisor = advisor;
}
public void addPublication(Publication p)
{
publications.add(p);
}
public ArrayList<Publication> getPublications() {
return publications;
}
public Professor getAdvisor()
{
return advisor;
}
public double calCurrentIncome(){
return publications.size()*1000;
}
}
package org.university.core;
public class Person {
protected String firstName;
protected String lastName;
protected String ID;
protected int joiningYear;
protected Department department;
public Person(String firstName, String lastName, String ID, int joiningYear, Department department)
{
this.firstName = firstName;
this.lastName = lastName;
this.ID = ID;
this.joiningYear = joiningYear;
this.department = department;
}
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;
}
public String getID() {
return ID;
}
public void setID(String ID) {
this.ID = ID;
}
public int getJoiningYear() {
return joiningYear;
}
public void setJoiningYear(int joiningYear) {
this.joiningYear = joiningYear;
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this.department = department;
}
}
package org.university.core;
import java.util.ArrayList;
public class Professor extends AbstractEmployee{
ArrayList<Course> courses = new ArrayList<>();
String group;
public Professor(String firstName,String lastName,String ID , int joiningYear , Department department ,String position , double basicIncome , String group){
super(firstName , lastName , ID , joiningYear , department , position , basicIncome);
this.group = group;
}
public Course[] getCourses() {
Course[] temp = new Course[courses.size()];
courses.toArray(temp);
return temp;
}
public void addCourse(Course c){
this.courses.add(c);
}
public String getGroup() {
return group;
}
@Override
public boolean isPromotable(){
return false;
}
}
package org.university.core;
public class Publication {
private String title;
private int year;
public Publication(String title,int year){
this.title=title;
this.year=year;
}
public int getYear() {
return year;
}
public String getTitle() {
return title;
}
}
package org.university.core;
public class ServiceEmployee extends AbstractEmployee {
public ServiceEmployee(String firstName,String lastName,String ID , int joiningYear , Department department ,String position , double basicIncome){
super(firstName , lastName , ID , joiningYear , department , position , basicIncome);
}
@Override
public boolean isPromotable(){
return false;
}
}
package org.university.core;
public class Statement {
private double amount;
private AbstractEmployee receiver;
public Statement(double amount, AbstractEmployee receiver) {
this.amount = amount;
this.receiver = receiver;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public AbstractEmployee getReciever() {
return receiver;
}
public void setReciever(AbstractEmployee reciver) {
this.receiver = receiver;
}
}
package org.university.core;
import java.util.ArrayList;
public class Student extends Person {
ArrayList<Course> courses = new ArrayList<>();
public Student(String firstName,String lastName,String ID , int joiningYear , Department department){
super(firstName , lastName , ID , joiningYear , department);
}
public void addCourse(Course c){
courses.add(c);
}
public ArrayList<Course>getCourses(){
return courses;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment