logo

Unit 20 Advanced Programming - Assignment

31 Pages3536 Words337 Views
   

Added on  2021-11-23

Unit 20 Advanced Programming - Assignment

   Added on 2021-11-23

ShareRelated Documents
ASSIGNMENT 1 FRONT SHEET
Qualification TEC Level 5 HND Diploma in Computing
Unit number and title Unit 20: Advanced Programming
Submission date Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name Student ID BHAF
Class Assessor name
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I
understand that making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P1 P2M1 M2D1 D2
~ 1 ~
Unit 20 Advanced Programming - Assignment_1
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date:
Internal Verifier’s Comments:
Signature & Date:
~ 2 ~
Unit 20 Advanced Programming - Assignment_2
~ 3 ~
Unit 20 Advanced Programming - Assignment_3
Table of ContentsI. Introduction........................................................................................................................5
II. The characteristics of the object-orientated paradigm.......................................................5
1. Object..............................................................................................................................6
2. Class..............................................................................................................................10
3. Abstraction....................................................................................................................12
4. Encapsulation................................................................................................................16
5. Inheritance....................................................................................................................19
6. Polymorphism...............................................................................................................24
III. The various class relationships.....................................................................................26
IV. Design UML class diagrams.........................................................................................28
V. Conclusion........................................................................................................................30
VI. References.....................................................................................................................31
~ 4 ~
Unit 20 Advanced Programming - Assignment_4
I. Introduction
‘Object-Oriented Programming’’ and ‘‘Data Abstraction’’ have become very common terms.
Unfortunately, few people agree on what they mean. In this assignment I will explain the
characteristics of object-oriented programming such as encapsulation, inheritance,
polymorphism, ... as well as different class relationships. After that, I will design a class
diagram based on a given code scenario.
This report consists of two sections:
1) The characteristic of the object-oriented paradigm as well as the various class
relationships.
2) Design a UML class diagrams.
II. The characteristics of the object-
orientated paradigm
OOP stands for Object-Oriented Programming. Object-oriented programming is a
methodology or paradigm to design a program using classes and objects. OOP focuses on the
objects that developers want to manipulate rather than the logic required to manipulate them.
This approach to programming is well-suited for programs that are large, complex and
actively updated or maintained.
An OO program: “a bunch of objects telling each other what to do by send messages”.
Some benefits of OOP:
Better abstractions (modeling information and behavior together).
Better maintainability (more comprehensible, les fragile).
Better reusability (classes as encapsulated components).
OOP has many features that make it useable including the followings:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation.
~ 5 ~
Unit 20 Advanced Programming - Assignment_5
Let’s discuss above each OOPs concepts with real-world example.
1. Object
The two most important concepts in object-oriented programming are the class and the
object.
The Object is the real-time entity having some state and behavior. In Java, Object is an
instance of the class having the instance variables like the state of the object and the methods
as the behavior of the object. The object of a class can be created by using the new keyword
in Java Programming language.
A class is a template or blueprint from which objects are created. So, an object is the
instance(result) of a class.
I can find various Object definitions as:
1) An object is a real-world entity.
2) An object is a runtime entity.
3) An object is a thing, both tangible and intangible, that we can imagine.
4) The object is an instance of class.
Real-world examples
A dog is an object because it has state (name, color, breed, hungry) and behavior
(barking, fetching, wagging tail). Chair, Bike, Marker, Pen, Table, Car, Book, Apple,
Bag etc. It can be physical or logical (tangible and intangible).
~ 6 ~
Unit 20 Advanced Programming - Assignment_6
Bicycle is an object. Bicycles also have state (current gear, current pedal cadence,
current speed) and behavior (changing gear, changing pedal cadence, applying
brakes).
How to Declare, Create and Initialize an Object in Java
A class is a blueprint for Object, you can create an object from a class. Let's take Student
class and try to create Java object for it.
I will create a simple Student class which has name and college fields. Then, I will write a
program to create declare, create and initialize a Student object in Java.
~ 7 ~
Unit 20 Advanced Programming - Assignment_7
From the above program, the Student object are:
~ 8 ~
Unit 20 Advanced Programming - Assignment_8

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Assignment on Application Development
|28
|9269
|140

Diploma in Computing Assignment PDF
|29
|2639
|216

Assignment on the Application of Room Carpet
|29
|3346
|81

OBJECT ORIENTED PROGRAMMING.
|5
|369
|484

Assignment on Explaining Polymorphism
|11
|1647
|313

Class And objectives in Java Laguage
|13
|1461
|20