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.

0 0
Add a comment Improve this question Transcribed image text
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:

Company -name : String +getName(): String -setname(String) void Department -name : String +getName(): String +setname(string)

************************************************************************************************************************************

In case of any doubt do ask in the comment section.Hope you like it

Add a comment
Know the answer?
Add Answer to:
Consider the following description below: In a company, each employee belongs to one department. One of...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • each of the data attributes. b. Accessor and mutator methods for each data attribute. An ..str method that returns a string indicating the state of the object 3. Look at the following description...

    each of the data attributes. b. Accessor and mutator methods for each data attribute. An ..str method that returns a string indicating the state of the object 3. Look at the following description of a problem domain: The bank offers the following types of accounts to its customers: savings accounts checking accounts, and money market accounts. Customers are allowed to deposh money into an account (thereby increasing its balance), withdraw money from an account (thereby decreasing its balance), and earn...

  • A company database needs to store information about employees

    A company database needs to store information about employees (identified by ssn, with salary and phone as attributes), departments (identified by dno, with dname and budget as attributes), and children of employees (with name and age as attributes) Employees work in departments; each department is managed by an employee; a child must be identified uniquely by name when the parent (who is an employee; assume that only one parent works for the company) is known. We are not interested in information...

  • *Python* INTRODUCTION: The goal of this programming assignment is to enable the student to practice object-oriented...

    *Python* INTRODUCTION: The goal of this programming assignment is to enable the student to practice object-oriented programming using classes to create objects. PROBLEM DEFINITION: Write a class named Employee that holds the following data about an employee in attributes: name, IDnumber, department, jobTitle The class should have 8 methods as follows:  For each attribute, there should be a method that takes a parameter to be assigned to the attribute. This is known as a mutator method.  For each...

  • JAVA HELP Design a class named Employee. The class should keep the following information in fields:...

    JAVA HELP Design a class named Employee. The class should keep the following information in fields: Employee name Employee number in the format XXX–L, where each X is a digit within the range 0–9 and the L is a letter within the range A–M. Hire date then, Write one or more constructors and the appropriate accessor and mutator methods for the class. Next, write a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to...

  • Define an interface FarmAnimal that contains two methods: getName() and talk(), each returns a string. Declare...

    Define an interface FarmAnimal that contains two methods: getName() and talk(), each returns a string. Declare an abstract class FarmAnimalBase that implements the interface FarmAnimal. In the class FarmAnimalBase, define a private final instance variable name (type: String), a public constructor that initializes the value of the instance variable name, and a public method getName() that returns the value of the instance variable name. Note that we do not implement the method talk() declared in the interface FarmAnimal, that’s the...

  • 1. Draw an ERD for the following situation. Be sure to show: entity information, attributes, identifier(s),...

    1. Draw an ERD for the following situation. Be sure to show: entity information, attributes, identifier(s), relationships and relationship names, and cardinality Each publisher has a unique name; a mailing address and telephone number are also kept on each publisher. A publisher may publish one or more books; a book is published by exactly one publisher. A book is identified by its ISBN, and other attributes are title, price, and number of pages. Each book is written by one or...

  • create java application with the following specifications: -create an employee class with the following attibutes: name...

    create java application with the following specifications: -create an employee class with the following attibutes: name and salary -add constuctor with arguments to initialize the attributes to valid values -write corresponding get and set methods for the attributes -add a method in Employee called verify() that returns true/false and validates that the salary falls in range1,000.00-99,999.99 Add a test application class to allow the user to enter employee information and display output: -using input(either scanner or jOption), allow user to...

  • Create an ERD using Lucid Chart for the following description. Be sure to include all necessary...

    Create an ERD using Lucid Chart for the following description. Be sure to include all necessary entities, attributes, and correct cardinality in relationships between entities. Don’t forget foreign keys. You have been asked to build a database for a technology company called TechNow. The company owner needs to keep track of the customers that buy their products, the employees that work at TechNow, the offices that the employees use, the vendors that provide them with products, and the products themselves....

  • Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN,...

    Consider the relational database schema for a company below. EMPLOYEE/NAME, SSN, BDATE, ADDRESS, SEX, SALARY, SUPERSSN, DNA) TA DEPARTMENT(DNAME, DNUMBER. MESSINS, MGRSTARTDATE) DEPT_LOCATIONS(DNUMBER. DLOCATION PROJECT(PNAME, PNUMBER. PLOCATION, DNLIM) WORKS_ONCESSN.PNG, HOURS) DEPENDENTESSN, DEPENDENT-NAME, SEX, BDATE, RELATIONSHIP) Write SQL statements for the following queries: a) List the names of those employees who work in the "Production" department (6 marks). b) Find the maximum salary, minimum salary, and the average salary among employees who work for the "Production department (6 marks). Count the...

  • Write a Java class named Employee to meet the requirements described in the UML Class Diagram...

    Write a Java class named Employee to meet the requirements described in the UML Class Diagram below: Note: Code added in the toString cell are not usually included in a regular UML class diagram. This was added so you can understand what I expect from you. If your code compiles cleanly, is defined correctly and functions exactly as required, the expected output of your program will solve the following problem: “An IT company with four departments and a staff strength...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT