Object-Oriented Programming Assignment: School Objects and UML

Verified

Added on  2022/09/05

|9
|1165
|19
Homework Assignment
AI Summary
This assignment showcases a student's understanding of object-oriented programming (OOP) principles, covering topics from weeks 1 through 7 of a course. The student begins by summarizing key concepts such as one-dimensional and two-dimensional arrays, associations, authoring classes, getters and setters, constructors, if-else and switch statements, objects and variables in Java, while, do-while, and for loops, encapsulation, polymorphism, method overriding, methods, and API packages. The second part of the assignment focuses on applying these concepts to a school-related example, identifying four key objects: students, courses, teachers, and enrollments. The relationships between these objects are defined, and a UML diagram is provided to visually represent the object-oriented design. The assignment concludes with a bibliography of relevant resources.
Document Page
Running head: OBJECT ORINETED PROGRAMMING
Object Oriented Programming
Name of the Student:
Name of the University:
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
OBJECT ORINETED PROGRAMMING
Answer to question number 1
Week 1
One dimensional arrays
The one dimensional arrays are the linear ones which includes a single subscript that
would be representing a row or column or an index. The one dimensional data structures are
represented in this type of arrays.
Two dimensional arrays
The two dimensional array are collection of cells which have same data however,
complex data is to be stored and hence, two dimensional matrices are required. This type of
arrays are great for the matrix representation and also the matrix operations are performed
efficiently.
Associations and collections
The array for the entities are known as the collection and association. The collection has
associations have separate data for separate entities.
Week 2
Authoring classes
The authoring classes are generally used for the verification and the validation of the
data. The method for authorization of the data are defined in these classes. The authorizing class
are generally described in the constructors.
Getters Setters
Document Page
2
OBJECT ORINETED PROGRAMMING
The getter and setter methods and defined in the classes to fetch the values from the users
and the set the values in the arrays and the getter methods are used for obtaining the values from
the arrays.
Constructors
The constructors are the ones in which the methods are defined and the test classes are
used for calling these constructors. The contractor classes are used for the description of the
constructor methods in the program. The test classes comes with the main class implementation
and the main methods are called.
Week 3
If else statements
The if else statements are used when then there are alternative options for a process and
the alternate conditions are selected as per the requirements of the algorithms.
Switch
Situations where there are a large number of options available, the if else statement is
elongated procedure which the processor has to follow. Hence, the switch cases are selected in
such scenarios where the workload of the compiler is reduced.
Week 4
Objects in java
The objects are the instances of the classes which are required to be developed in the
systems.
Variables in java
Document Page
3
OBJECT ORINETED PROGRAMMING
The variables are used for storing the static or dynamic values in the memory which is
then used by a java program.
Structure in java
The structure consists of a group of variables which would be useful in defining a
particular object instance. There is various type of structure available in java. The structure is
able to perform or represent data in the format in which arrays are unable to represent them. The
structures are used for different type of methods, which would use the getter and setter values to
use the methods.
Week 5
While Loop
The while loop is used for performing the loop functions in a java program and the
looping continues till the while function is valid. In addition to this, the while loop makes use of
the conditions for which the loop function can be run.
Do while Loop
The do while loop is almost similar to the while loop. In this loop the condition is set
however, the break condition is entered as soon as the scope of the condition is over.
For Loop
The for loop is used for the finite iteration of the results. The finite limit can be set by the
users, and additionally the decremented iteration can be performed easily with the for loop.
Week 6
Encapsulation
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
OBJECT ORINETED PROGRAMMING
This builds the idea of the data bundle and the methods which works within java
programming. The internal representations of the objects are hidden from the outside in this
phenomenon. The attributes are not obtained from the outside only the ones having access to a
certain data in the class. The outsiders would only be able to read and write the data.
Polymorphisms
The ability of the objects to take in type of forms are known as polymorphism, the parent
class is able to refer to many child classes in java and the child class would be able to refer to the
parent class while calling the methods from that class.
Overriding methods
The method overriding process is used by the java classes and the hereditary of the
methods which would be discussed in the parent classes and the child class would be required to
form different type of signature for the different methods and also the classes can be derived in
cases where the signature have not been changed.
Week 7
Methods
The methods are the functions which are generally used in the java classes so that the
user can perform the functions effectively. In addition to this, the methods would be able to
perform the repetitive functions which would be used for operations.
API packages
The API packages would be used for the input and output support classes. The java
system classes and the packages that would include in the APIs are the vectors, hash tables,
Document Page
5
OBJECT ORINETED PROGRAMMING
random numbers, data, and the string operations. The GUI classes are also including within these
API. Additional google and other software APIs are also used in java which would come with
the predefined functions that would helpful in performing the operations which are not available
already.
toString methods
The toString method is used for the transformation of data to strings.
Answer to question number 2
The chosen topic is school. The four objects which are obtained from the topic are
students, courses, teachers and enrollments.
The students are the ones who would be related with the enrollments object. The relation
in between them would be one to many in between the students and enrollment. The students
would be enrolled into the courses hence, the relation in between the courses and the enrollments
are one to many. In addition to this, the relation in between the teachers and the enrolment would
also be one to many as a single teacher would be enrolled in many courses. The UML diagram
provided below would be helpful for the identification of the objects identified in the system:
Document Page
6
OBJECT ORINETED PROGRAMMING
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7
OBJECT ORINETED PROGRAMMING
The sub groups and the additional relationships have been further developed in the
diagram provided below:
Document Page
8
OBJECT ORINETED PROGRAMMING
Bibliography
Joyce, D.T. and Weems, C., 2016. Object-oriented data structures using Java. Jones & Bartlett
Publishers.
Koster, A. (2015). Teaching Object-Oriented Programming: A comparison of Java and
Objective-C. International Journal of Management & Information Systems (IJMIS),
19(1), 7-12.
chevron_up_icon
1 out of 9
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]