|
Assignment 6 Remember that important terms are bolded at least once. |
|
Assignment 6A |
|
Create a list of 5 flowers. Add a picnic
table to the world as well. Create an
event that uses When mouse clicked to perform a method you have also created named PlaceOnTable. The PlaceOnTable
method should have a parameter
named WhichFlower.
Use the parameter in PlaceOnTable to get the
flowers to move to the top of the picnic table. The main method should display 3-D text
that says “Click on each flower to play” or whatever to communicate to the
user what to do. The PlaceOnTable is probably best placed in the Click
event. You can optionally place it in the my first method if that method is called from the
click event. Depends on how you set it
up. It MUST have a list, however. NOTES to remember (In real
programming languages you would have to fill this list with a loop, an interation structure – similar to
the description of an array in
chapter 10 of the text. However, when using lists in In index. The index IS
being changed, but the programmer does not see the built-in code which is one
of the advantages of object oriented programming since all of |
|
Assignment 6B |
|
Notes to remember first Although
lists and arrays have some major differences in Questions 1. What is the value of the index position
for the first element in an array/list __________ 2. The project you created in Part A
required a mous click in order to execute. Clicking a mouse is referred to as
a(n)_________________ 3. How many items are stored in the
list/array of flowers?____________ 4. Create a class diagram for the
class flowerpot that you used in the project.
You do not need to include all of the properties and methods…3 of each
will do. 5. Would all flowerpots have these
same attributes and methods?
________________ 6. Consider question 5 and explain
WHY ______________________________ 7. Define a list/array- remember in a
real language there is no significant difference. 8. Create a Use Case for the small
application you wrote in Assignment 6A. 9. What is the advantage to breaking
a program into many “independent” methods? 10.Some programming languages
allow the use of a concept named ‘polymorphism’. Use the following source to learn what it
is. It is also a good source for some
other explanations. http://home.cogeco.ca/~ve3ll/jatutor5.htm It uses JAVA as an example. 11. Give an example
NOT in the material assigned or research of polymorphism. |