Object-Oriented Programming Task 3
Object-Oriented Programming Task 3
Student's name
Jackson palace
Enrollment
200411039
Task Name
Task 3
Unit # 3
Object-Oriented Programming
Date
22/01/2023
lOMoARcPSD|12618438
Unit #: 3
Object-Oriented Programming
ACTIVITY 3
CLASS
HAT
The variables that refer to local objects and their values are stored in memory.
pila, while the objects they point to are stored in dynamic memory space
(heap)
Sun Microsystems
Objectives:
Instructions:
Review the materials corresponding to the resources for week 3, as well as the previous Open Classes and
of the current week that the subject teachers have taught.
Assessment method:
Criterion Weighting
Presentation. 10%
Unit #:3
Object-Oriented Programming
activity.
Unit #: 3
Object-Oriented Programming
Word document must also include execution screens of the program, where it can be
corroborate the date and time of execution. If you have a programming IDE that does not
throw the date and time at the moment of the run, so the date and time of your must be noted
computer, for example:
It is important to highlight that not only should screens of successful executions be included, but also
also from those where the program did not function correctly and in the Development of the
actividad debes comentar cómo hiciste para corregirlas.
D. The document must include Introduction, Development, Conclusions, and Bibliography in APA format.
The introduction of your work must contain at least half a page, where it explains the
importance of object-oriented programming, the creation of objects, the definition of
object diagram created in UML, the importance of attributes and methods.
Elaborar por lo menos media página de conclusión donde se expresen, los beneficios de la
object-oriented programming, the experience of developing the hat class and what it
Can you recommend how to identify each of the elements of object-oriented programming?
objects. Keep in mind that this activity is evaluated with a weighting of 15% of the grade.
Remember that everything must be written by you, it should not be copied and pasted from any website.
lOMoARcPSD|12618438
Unit #:3
Object-Oriented Programming
Problem to be solved
HAT CLASS
Remove ()
+ Put ()
+ Clean ()
Hang
Unit #:3
Object-Oriented Programming
II.- INSTRUCTIONS. Underline which of the following lines is creating an object of the
Hat class
III.- INSTRUCTIONS. Indicate which of the following lines of code indicates 'the call to a method' of the
hat class
[Link]=”blanco”;2
[Link]();
3 [Link]= ’L’;
lOMoARcPSD|12618438
Unit #:3
Object-Oriented Programming
IV.- INSTRUCTIONS. Develop the Java program for the class "Hat" that corresponds to the
UML diagram of the INSTRUCTIONS I, (figure 3.2) corresponding to the class diagram Hat.
E. You must define the attributes and create the corresponding methods for the hat class.
F. Create at least three hat objects with differences in their attributes and execute the methods of the
Hat class for each one.
Example output of the program of an object of the Hat class, remember that you must create at least
three distinct objects:
Unit #: 3
Object-Oriented Programming
SOURCE CODE.
MainMethod
public class MetodoMain extends Sombrero{
}
lOMoARcPSD|12618438
Unit #: 3
Object-Oriented Programming
Hat
public class Hat {
public Sombrero() {
}
public Sombrero(int sombreroId, String color, String size, String model) {
[Link] = idSombrero;
[Link] = color;
[Link] = talla;
[Link] = model;
}
public int getHatId() {
return hatId;
}
public void setHatId(int hatId) {
[Link] = idSombrero;
}
public String getColor() {
return color;
}
public void setColor(String color) {
[Link] = color;
}
public String getSize() {
return size;
}
public void setSize(String size) {
[Link] = size;
}
public String getModel() {
lOMoARcPSD|12618438
Unit #: 3
Object-Oriented Programming
return model;
}
public void setModelo(String modelo) {
[Link] = model;
}
REFERENCES.
Basic principles of Object-Oriented Programming in Java (angel70java, 2014)
Object-Oriented Programming(Nereu, 2014).