Provide a UML diagram for the Employee class, using the table provided on page 3
ID: 3883096 • Letter: P
Question
Provide a UML diagram for the Employee class, using the table provided on page 3. Discussion on UML diagrams can be found throughout Chapter 6. Be sure to include all of the following:
Member variables and member functions
Access specifiers for all member variables and member functions
Data types for all member variables
Data types for all parameters
Return types for all member functions and constructors
public class Employee
{
// Fields
private String name; // Employee's name
private int idNumber; // ID number
private String department; // Employee's department
private String position; // Job title
public Employee()
{
name = "";
idNumber = 0;
department = "";
position = "";
}
public Employee(String n, int id,
String dept, String pos)
{
name = n;
idNumber = id;
department = dept;
position = pos;
}
public Employee(String n, int id)
{
name = n;
idNumber = id;
department = "";
position = "";
}
public void setName(String n)
{
name = n;
}
public void setIdNumber(int num)
{
idNumber = num;
}
public void setDepartment(String d)
{
department = d;
}
public void setPosition(String p)
{
position = p;
}
public String getName()
{
return name;
}
public int getIdNumber()
{
return idNumber;
}
public String getDepartment()
{
return department;
}
public String getPosition()
{
return position;
}
}
I need a table diagram
Explanation / Answer
UML DIAGRAM
Format of UML Class Diagrams
where
Employee -name:String-idNumber:int
-department:String
-position:String +Employee()
+Employee(String, int,String,String)
+Employee(String,int)
+getName():String
+getIdNumber():int
+getDepartment():String
+getPosition():String
+setName(String):void
+setIdNumber(int):void
+setDepartment(String):void
+setPosition(String):void
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.