Question

In: Computer Science

DUE IN TWO HOURS ASAP PLEASE!!! Given the following specification, design a class diagram using PlantUML....

DUE IN TWO HOURS

ASAP PLEASE!!!

Given the following specification, design a class diagram using PlantUML. To design the class diagram, use abstract (10 points), static (10 points), package (20 points ), namespace (20 points ), association (20 points ), and generalization (20 points ) on PlantUML

Specification:

  • A school has a principal, many students, and many teachers. Each of these persons has a name, birthdate, and may borrow and return books. The book class must contain a title, abstract, and when it is available. Teachers and the principal are both paid a salary.
  • A school has many playgrounds and rooms. A playground has many swings. Each room has many chairs and doors. Rooms include offices, restrooms, classrooms, and a cafeteria. Each classroom has many computers and desks. Each desk has many rulers.  

Submit a DOC/PDF file including PlantUML script and diagram.

Solutions

Expert Solution

ANSWER:

Class diagram describes the attributes and operations of a class and also the constraints imposed on the system. The class diagrams are widely used in the modeling of object oriented systems because they are the only UML diagrams, which can be mapped directly with object-oriented languages.

We can classify the above specifications into two broader categories.
1. Defining members of school
2. Defining infrastructure of school.
We have defined these broader classification as different packages. Memebrs and Infrastructure

Members:
We can have 3 types of person : Principal, Teachers, Students (Generalisation)
Each person class have name and birthdate. These holds true for all three specific types hence these are properties of superclass.
However only Teacher and Principal have specific attribute - salary.
Person can borrow books. (1 person can borrow many books and a single book is borrowed under name of single person at a time hence 1:N association exists here)

Infrastructure:
Consists of:
- Books (that a person can borrow)
Have attributes title and abstract
Is also have methods - isAvailable that checks whether book is available at that point of time
- borrow() and return() to perform borrow and return operation on book.
- PlayGround (1 playground can have many swings depicts a 1 to many association)
- Room (1 room can have many doors and desks 1:N association)
Rooms can be of 4 types : Office, Restroom, ClassRoom, Cafeteria (Categories of room => Generalisation)
- Desk can have many rulers (1:N association)

Below is the code to generate required class diagram on PlantUML

@startuml
School "1" -down-> "1" Members.Principal
School "1" -down-> "N" Members.Student
School "1" -down-> "N" Members.Teacher
School "1" -down-> "N" Infrastructure.PlayGround
School "1" -down-> "N" Infrastructure.Room

package Members {
abstract class Person {
  name
  birthDate
}

class Teacher {
  salary
}
class Principal {
  salary
}
class Student 
Person <|-- Teacher
Person <|-- Student 
Person <|-- Principal

Person "1" - "N" Infrastructure.Books : borrow
}
package Infrastructure {
  class Books {
    title
    abstract
    isAvailable()
    borrow()
    return()
  }
  Playground "1" - "N" Swing : has
  Room "1" -left-> "N" Chair : has
  Room "1" -right-> "N" Door : has
  Room <|-- office
  Room <|-- RestRoom
  Room <|-- ClassRoom
  Room <|-- Cafeteria
  ClassRoom "1" -left-> "N" Computer : has
  ClassRoom "1" -right-> "N" Desk : has
  Desk "1" -down-> "N" Ruler : has
}

( PLEASE VOTE FOR THIS ANSWER )

I THINK IT WILL BE USEFULL TO YOU ...............

PLZZZZ COMMENT IF YOU HAVE ANY PROBLEM I WIL TRY TO SOLVE IT ............

THANK YOU ........


Related Solutions

Given the following specification, design a class diagram using PlantUML. To design the class diagram, use...
Given the following specification, design a class diagram using PlantUML. To design the class diagram, use abstract, static, package, namespace, association, and generalization on PlantUML Specification: A school has a principal, many students, and many teachers. Each of these persons has a name, birth date, and may borrow and return books. The book class must contain a title, abstract, and when it is available. Teachers and the principal are both paid a salary. A school has many playgrounds and rooms....
asap please python Using block diagram, design the architectural layout of the simplified model of a...
asap please python Using block diagram, design the architectural layout of the simplified model of a symmetric Cryptosystem. Implement a cryptosystem columnar transposition technique with a 4 x 4 matrix arrangement. Test your code with ‘cryptography’ as the plaintext.
Program Specification Design an inventory class that stores the following members: serialNum: An integer that holds...
Program Specification Design an inventory class that stores the following members: serialNum: An integer that holds a part's serial number. manufactDate: A member that holds the date the part was manufactured. lotNum: An integer that holds the part's lot number. The class should have appropriate setter and getter functions. Next, design a stack class that can hold objects of the class described above. If you wish, you may use the linked list from program 5 as a basis for designing...
Complete the following class UML design class diagram by filling in all the sections based on...
Complete the following class UML design class diagram by filling in all the sections based on the information given below.         The class name is Boat, and it is a concrete entity class. All three attributes are private strings with initial null values. The attribute boat identifier has the property of “key.” The other attributes are the manufacturer of the boat and the model of the boat. Provide at least two methods for this class. Class Name: Attribute Names: Method...
Given the following UML class diagram, implement the class as described by the model. Use your...
Given the following UML class diagram, implement the class as described by the model. Use your best judgment when implementing the code inside of each method. +---------------------------------------------------+ | Polygon | +---------------------------------------------------+ | - side_count : int = 3 | | - side_length : double = 1.0 | +---------------------------------------------------+ | + Polygon() | | + Polygon(side_count : int) | | + Polygon(side_count : int, side_length : double) | | + getSides() : int | | + setSides(side_count : int) | |...
I need this as soon as possible, please. It is due two hours and I need...
I need this as soon as possible, please. It is due two hours and I need to check my answers. Problem-1 Calculate the Product of the following using refined multiplication method (show all steps in table)                                                                 6 X 3 Problem-2 Calculate the Product of the following using Booth’s Multiplication Algorithm (show all steps in table) 5 X (-4) (-3) X (-6)
Please provide the missng code(parts) for the given code in java. ASAP. import java.util.Stack; class StackQueue<T>...
Please provide the missng code(parts) for the given code in java. ASAP. import java.util.Stack; class StackQueue<T> implements Queue<T>{ private Stack<T> inStack; private Stack<T> outStack; private int size; public StackQueue(){ inStack = new Stack<T> (); outStack = PART(a); size = 0; } public int size(){ return size; } public boolean isEmpty(){ return size==0; } public T first(){ if (size == 0) return null;; if (outStack.empty()) while (!inStack.empty()) outStack.push(inStack.pop()); return PART(b); //return the element at the top of the outStack without removing...
Term Project C++ Pet Class Problem Specification: Design a class named Pet, which should have the...
Term Project C++ Pet Class Problem Specification: Design a class named Pet, which should have the following fields: • name: The name field holds the name of a pet. • type: The type field holds the type of animal that a pet is. Example values are “Dog”, “Cat”, and “Bird”. • age: The age field holds the pet’s age. The Pet class should also have the following methods: • setName: The setName method stores a value in the name field....
Write a java program using the following information Design a LandTract class that has two fields...
Write a java program using the following information Design a LandTract class that has two fields (i.e. instance variables): one for the tract’s length(a double), and one for the width (a double). The class should have:  a constructor that accepts arguments for the two fields  a method that returns the tract’s area(i.e. length * width)  an equals method that accepts a LandTract object as an argument. If the argument object holds the same data (i.e. length and...
Please Solve it ASAP. "A company's present worth (PW) is given by the following equation: PW...
Please Solve it ASAP. "A company's present worth (PW) is given by the following equation: PW = -$180069 + 2.056X(Y-15) + 33180S, where X is the demand, Y is the unit price, and S is a factor that determines the salvage value. All three of these are random variables. Use simulation, like SIPMath, to simulate the present worth of BMC with 100,000 trials. Set X as a normal distribution with mean 2415 and standard deviation 119. Set Y as a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT