DBS B8IT117: Object Oriented Programming Practical Assignment Solution

Verified

Added on  2022/08/11

|3
|563
|22
Practical Assignment
AI Summary
Document Page
Running head: Security in Computing and IT
B8IT117:Object Oriented Programming
Name of the Student
Name of the University
Authors note
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1SECURITY IN COMPUTING AND IT
UML diagram for the project
Use of inheritance in the Program
For this program, one of the most important object-oriented programing concepts used is
the inheritance of the classes. Through the inheritance, it was possible to define a derived class in
terms of another previously defined class. In this way this concept made it easier the CRUD
application for the students, administrators and lecturers. This inheritance is also helpful for
reuse of the code block, functionality reusability while speeding up the implementation of the
applications. While developing a newer class rather than writing the completely new data and
member functions the inheritance helps the programmer to designate new class in order to inherit
members of the previously defined base class. The existing class is noted as base class, and the
class inheriting the properties of previous class is referred as derived class.
Document Page
2SECURITY IN COMPUTING AND IT
Switch case for the Programming project
Another important concept utilized was switch case for control flow in the program.
Depending upon the value of specific choice of the users the control flow is determined. The
expression that determines the control flow in the switch statement needs to be integer or
enumerated type of data. In this control statement it is possible to declare numerous numbers of
case statements inside the switch switch. Each of the cases inside it compared to the user input
and executes the code bock under it whenever a match is found.
It is important to keep in mind that constant-expression for each of the case statements
must be of same data type as variable type used in the switch. This variable can be a constant or
a literal. After executing the code block inside the case can the control flow reaches to the break
statement and the switch is terminated. After this the flow of control of the program jumps to the
next switch statement or asks for next user input. Here it can be stated that not all the cases
require a break statement but lack of the break may lead to raising a compile error.
The switch case control can optionally have default case that is executed whenever none
of cases inside a switch statement turns out to be true.
Use of Array list to store the details
In order to store the data about the students, lecturers and administrators the ArrayList
data structure is utilized. The array list characterizes an ordered collection of similar or different
objects that can be easily indexed individually. This can be considered as the alternative to the
basic data structure array.
The ArrayLists time required for addition and removal of the elements smaller than other
similar data structures. There are some inbuilt methods that makes the operations on the array list
easier one and it does not guarantee to be sorted for the different objects. Indexes for the
arraylist data structure are mainly zero-based. Furthermore, this data structure also allows storing
duplicate elements while storing the collection of t different objects or elements.
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]