Reference no: EM1379002
Question: Object oriented design is making classes with both characteristics and behavior wrapped together (called encapsulation). Taking data (characteristics) and the functions (behavior) that operate on that data and storing them as one programming unit (called a class) is extremely powerful. When completing a class design it is critical to ask two very important questions: 1- What does it (the class) know (characteristics)? and 2- What can it (the class) do (behavior)? In chapter 3, fig 3.9 (p. 99) is the UML (Unified Modeling Language) class diagram for the GradeBook class in fig 3.7 (p. 95). This diagram answers the two questions above:
1. What does it know? It knows its course name (courseName).
2. What can it do?
a. It can set its course name if it's given a name (setCourseName(name : String))
b. It can get and return its course name (getCourseName() : String)
c. It can display a message (displayMessage())
Looking for another example, I just picked up the stapler on my desk. The following is a design for a stapler class by answering the two questions "What does it know?" and "What can it do?" Following that is the UML class diagram.
Stapler class:
1. What does it know?
a. It knows how many staples it has
b. It knows if its jammed
c. It knows its weight
2. What can it do?
a. It can reload, fill its staples to capacity
b. It can get an return whether it is jammed
c. It can staple, which decreases its number of staples by one
d. It can get and return its weight
Stapler
--------------------------
- totalStaples : integer
- jammed : Boolean
- weight: float
--------------------------
+ reload()
+ isJammed() : boolean
+ staple()
+ getWeight() : float
THE ABOVE IS JUST AN EXAMPLE:
Details of assignment: Choose an object from everyday life and design a class for it by answering the two questions and providing a UML class diagram. The subject of your post must be the name of your class. Mine would be Stapler. Your class must have a minimum of three characteristics and five behaviors.
Classification of symbols
: In few programming languages a comment can be enclosed either in braces {} or in the symbols (* *). Discuss how do you think a scanner would group the four symbols {, }, (*, *) for purposes of classification.
|
Java examples to validate input
: Create an algorithm that prompts the user to enter a secret word. The secret word should be at least eight characters long. Validate the input.
|
Role of it management in organizations
: Write a statement of what you perceive the role of IT management in organizations and address the IT management challenges that e-business brings.
|
Evaluate the intended audience
: Question: In order for technical communication to be effective, the writer must evaluate the intended audience, its characteristics, knowledge base, expectations, and needs.
|
Object oriented designing class
: Object oriented design is making classes with both characteristics and behavior wrapped together. Taking data and the functions that operate on that information and storing them as one programming unit is extremely powerful.
|
Fdtd evaluation of the sar distribution
: Finite Difference Time Domain (FDTD) numerical method to develop for me a software program that simulates - evaluates Specific Absorption Rate (SAR) Distribution in a Human Head Near a Mobile Cellular Phone as a student project.
|
Path and editor variables in linux login
: Login to Linux environment and construct start-up shell script. Whether you write the scripts as .profile or .cshrc, include the following options:
|
Determine the greatest magnitude negative number
: Determine the greatest magnitude negative number one can represent in an 8-bit 2's complement code? Write your result in binary and decimal.
|
Linux commands
: Project Linux commands. Please record all commands on a Microsoft Word Doc.
|