You are on page 1of 4

Kingdom of Saudi Arabia ‫المملكة العربية السعودية‬

Ministry of Higher Education


Najran University
‫وزارة التعليم العالي‬
Faculty of Computer Science and
‫جامعة نجران‬
Information Systems
‫كلية علوم الحاسب ونظم المعلومات‬

Assignment# 1

Course Code: 113CSS-4 Theory

Course Name: Object Oriented Programming Due Date:29/12/2022

Student Name:_____________________________________ ID:____________________

=========================================
[Assignment 1 - is related to CLO # 2 and 3]
CLO-2: Design programs utilizing the principles of object oriented to solve simple computational
problems.
CLO-3: “Implement object-oriented principles to effectively and efficiently solve computational
problems involving multiple objects”.

Design and implement java program for " Covenant System"; the system stores a
covenant name, type and date for each object. Also, each Covenant should have the
employee name and ID. The system contains a Covenant class and TestCovenant
class. To implement the class, you must: (not exclusively)
1. Make at least one constructor to initialize the object with a Date object and ID.
2. Each private data must have setter and getter method.
3. In the main class you have to create 5 Covenants objects and assign for each
object its (name, id, datecreated, Employee name, Employee ID).

- Submit UML class diagram for the Covenants class with Java codes and
screenshot of the output (all in one .docx or PDF file).
- If there is any copy and paste; the assignment's grade will be 0(zero).
- If the assignment is submitted late; two marks will be deducted.
Kingdom of Saudi Arabia ‫المملكة العربية السعودية‬
Ministry of Higher Education
Najran University
‫وزارة التعليم العالي‬
Faculty of Computer Science and
‫جامعة نجران‬
Information Systems
‫كلية علوم الحاسب ونظم المعلومات‬

Covenant.java
public class Covenant {

private String covenantName, covenantType, covenantDate,


employeeName, employeeID;

public Covenant(String covenantName, String covenantType, String


covenantDate, String employeeName, String employeeID) {
this.covenantName = covenantName;
this.covenantType = covenantType;
this.covenantDate = covenantDate;
this.employeeName = employeeName;
this.employeeID = employeeID;
}

public String getCovenantName() {

return this.covenantName;
}

public void setCovenantName(String s) {


this.covenantName = s;
}

public String getCovenantType() {

return this.covenantType;
}

public void setCovenantType(String s) {


this.covenantType = s;
}

public String getCovenantDate() {

return this.covenantDate;
}

public void setCovenantDate(String s) {


this.covenantDate = s;
}

public String getEmployeeName() {

return this.employeeName;
}

public void setEmployeeName(String s) {


this.employeeName = s;
}
Kingdom of Saudi Arabia ‫المملكة العربية السعودية‬
Ministry of Higher Education
Najran University
‫وزارة التعليم العالي‬
Faculty of Computer Science and
‫جامعة نجران‬
Information Systems
‫كلية علوم الحاسب ونظم المعلومات‬

public String getEmployeeID() {

return this.employeeID;
}

public void setEmployeeID(String s) {


this.employeeID = s;
}

public void pritInfo() {


System.out.println("Covenant Name : " + covenantName);
System.out.println("Covenant Type : " + covenantType);
System.out.println("Covenant Date : " + covenantDate);
System.out.println("Employee Name : " + employeeName);
System.out.println("Employee ID : " + employeeID);
System.out.println("\n");

TestCovenant.java
Kingdom of Saudi Arabia ‫المملكة العربية السعودية‬
Ministry of Higher Education
Najran University
‫وزارة التعليم العالي‬
Faculty of Computer Science and
‫جامعة نجران‬
Information Systems
‫كلية علوم الحاسب ونظم المعلومات‬

OUTPUT

UML

Covenant
+Covenant(String covenantName, String covenantType, String covenantDate,
String employeeName, String employeeID)
-String: covenantName
-String: covenantType
-String: covenantDate
-String: employeeName
-String: employeeID
+getCovenantName():String
+getCovenantType ():String
+getCovenantDate ():String
+getEmployeeName ():String
+getEmployeeID():String
+setCovenantName(String s):void
+setCovenantType(String s):void
+setCovenantDate (String s):void
+setEmployeeName (String s):void
+setEmployeeID (String s):void
+pritInfo():void

You might also like