Question

Consider the following description below: In a company, each employee belongs to one department. One of...

Consider the following description below:

In a company, each employee belongs to one department. One of the employees of a department is the Head of Department.

Each department occupies one or more offices. An office can be occupied by no department or by one department.

An employee is identified by an id and has a name. A department is identified by its name. An office is identified by its office number.

Draw a class diagram for the above scenario to show the types (classes) of objects that can exist and the relationships among them.

For each class, show

– The class name and

– The names of its mutator methods

You do not have to specify the attributes nor the parameters of the methods. Obviously, you should choose sensible names for the classes and methods.

Homework Answers

Answer #1

For class diagram we must notice:

1. Each department has 1 or more office

2. Each office has no or more departments

3. Each employee associated with only 1 department

4. Each department associated with many employees.

Hence, the class diagram is:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
In C++ Employee Class Write a class named Employee (see definition below), create an array of...
In C++ Employee Class Write a class named Employee (see definition below), create an array of Employee objects, and process the array using three functions. In main create an array of 100 Employee objects using the default constructor. The program will repeatedly execute four menu items selected by the user, in main: 1) in a function, store in the array of Employee objects the user-entered data shown below (but program to allow an unknown number of objects to be stored,...
A company consists of departments and employees. A department has responsibility for zero, one or more...
A company consists of departments and employees. A department has responsibility for zero, one or more projects. A company has: name, address and telephone. A department has name. A project has name. An employee has name, address, a social security number (SSN) and is participating in zero, one or more projects. Let the E-R diagram show: entities with attributes, relationships (with names) between the entities and cardinalities for the relationships.                               CR[15 Marks] Transform the E-R model into Relational model.
A university is a very busy place with a lot of students and also a lot...
A university is a very busy place with a lot of students and also a lot of employees to keep the system running perfectly. All people in the university have basic information like name, address, email and phone number. Employees at the university have extra information like employee-id and salary. There are also faculty and staff who are employees at the university. Each faculty has a designation and is assigned to a specific college and has number of courses taught....
Specify the following queries in SQL on the COMPANY database. Show the result of each query....
Specify the following queries in SQL on the COMPANY database. Show the result of each query. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ‘ProductX’ project. List the names of all employees who have a dependent with the same first name as themselves. Find the names of all employees who are directly supervised by ‘Franklin Wong’. Specify the following updates using the SQL update commands. Show the state of...
6) Consider the following class descriptions for objects in a video game: An NPC (non-player character)...
6) Consider the following class descriptions for objects in a video game: An NPC (non-player character) in a video game has some basic data that belongs to all entities in a game. All NPCs have a name, which is a String, health, which is an integer, and a description, which is a String. NPCs have accessor methods for each of their instance variables. NPCs also have an act() method, which is void; however, since there are no true NPCs in...
6) Consider the following class descriptions for objects in a video game: An NPC (non-player character)...
6) Consider the following class descriptions for objects in a video game: An NPC (non-player character) in a video game has some basic data that belongs to all entities in a game. All NPCs have a name, which is a String, health, which is an integer, and a description, which is a String. NPCs have accessor methods for each of their instance variables. NPCs also have an act() method, which is void; however, since there are no true NPCs in...
Consider the scenario where the company has to automate its systems and wants to store details...
Consider the scenario where the company has to automate its systems and wants to store details of its employees where their empno, name, salary, DoB, age, gender and panNo . empno is the primary key, phNo has to be stored. Age is a derived attribute . panNo is a simple attribute Each employee belongs to one the various departments (dno, dname) in the organization. It is mandatory for each employee to get the medical insurance. The insurance details are also...
Consider a relational DBMS that has two relations: Emp (employees) and Dept (departments).    Emp(id, name,...
Consider a relational DBMS that has two relations: Emp (employees) and Dept (departments).    Emp(id, name, age, salary, dname)    Dept(dname, location) - The Emp table has 500 tuples, and each tuple has a fixed length of 500 bytes. The primary key attribute "id" has a length of 40 bytes. - The Dept table has 100 tuples, and each tuple has 200 bytes. The primary key attribute "dname" has a length of 20 bytes. For simplicity, we assume each employee...
This program is in C++: Write a program to allow the user to: 1. Create two...
This program is in C++: Write a program to allow the user to: 1. Create two classes. Employee and Departments. The Department class will have: DepartmentID, Departmentname, DepartmentHeadName. The Employee class will have employeeID, emploeename, employeesalary, employeeage, employeeDepartmentID. Both of the above classes should have appropriate constructors, accessor methods. 2. Create two arrays . One for Employee with the size 5 and another one for Department with the size 3. Your program should display a menu for the user to...
Goal:   Manage the inventory of objects sold in an online or brick and mortar store. If...
Goal:   Manage the inventory of objects sold in an online or brick and mortar store. If you can't implement all of the features of Project described in this document, implement what you can. Start by implementing the StockItem class, and its derived classes. Then add in the InventoryManager class later. In each case, the test files must be in separate classes. UML Diagram: Use Violet or other drawing software to draw the UML diagrams of each class that you use...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT