Object Oriented Programming Concepts - Assignment

Added on - 12 Aug 2021

  • 31


  • 1680


  • 18


  • 0


Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 8 of 31 pages
Task 01
OOP Concepts
Every class has a class name and class scope. It determines by “{ }”. A class is a destination
from which objects are created.It represents the set of properties or methods or functions that
are common to all objects of one type. Objects are created inside a Class and it comprises
methods and functions which are in one type and common to all objects.
[CITATION Tec16 \l 1033 ]
DBConnection is used to connect the ‘JDBC-ODBC Bridge’ between the system and the storing
software (SQL Server). DBConnection is basically used to store the data which is input by the
user. When the data is input the DBConnection will pass to the SQL Server to store the data.
Through this the data which known as insert values, retrieve values will be process with the
database. If there is an error with storing, the DBConnection must be rechecked.
Figure 1
known as a
thing and it is
an entity which has state and behavior. The state is represented as properties and the behavior
represented as functions.
For an instance, a car, a bike and any physical or logical thing can be describing as an object.
The states/ properties/ attributes of a car can be illustrated by Color, Speed, Size, Engine and so
on. Moreover, the behavior/ Functionalities of a car will be drive, turn right or left and so on.
[ CITATION Gur19 \l 1033 ]

Figure 2
The classes are inherited by a super class or super classes. In this concept the sub classes are
inherited the variables and other methods from the parent class. This is a crucial part of OOP.
The inheritance in the sense of a class is created upon an existing class and when the new class
inherits from the existing class, the methods and fields of parent class can be used and it is
known as reusability.
Inheritance can be represented the IS-A relationships and can be known as a parent-child
relationship as well.
[ CITATION jav18 \l 1033 ]
There is diverse type of inheritance
An abstraction is used to hide data in order to reduce the unnecessary features of the system and
make the system as a user friendly. Abstraction depicts the only essential components and the
non-essential components for the user will be hidden. Hence the implementation will be hidden
from the user and only the functionalities will be provided.
[ CITATION Gee \l 1033 ]
Polymorphism can be defined as a concept which is performed a single action in diverse ways.
There are two types in Polymorphism:
Overloading – In here same methods are separating inside a class
Overriding – Same methods are repeating inside the subclass and the superclass
[ CITATION Jav18 \l 1033 ]
Encapsulation is the concept where data are hidden, in order to hide the complexity of the
system. A completed encapsulated class can be created by making all the data methods of the
class private. In here the variables of a class will be hidden from other classes and the hidden
class can be retrieved only via the methods of the existing class. In Encapsulation there are
different access modifiers:
Private – the property which is accessible only within the class
Public – the property which can access anywhere in the program
Protector – the property which can access anywhere only within package
[ CITATION jav181 \l 1033 ]
Task 02
Use case diagram
Figure 4
Class Diagram
Task 03
This is the login form where the user can login either as an administrator (admin) or a HR.
Figure 7
Here in this form correct user ID and the password should be entered and select the user type
before clicking the login button.
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document