Chapter 1: VN 1.4 Solving a challenge exercise
Exercise 1:
Add a sunset to the single-sun version of Picture. That is: make the sun go
down slowly. Remember: The circle has a method slowMoveVertical
that you can use to do this.
Exercise 2: If you added your sunset to the end of the draw
method (so that the sun goes down automatically when the picture is
drawn), change this now. We now want the sunset in a separate method,
so that we can call draw and see the picture with the sun up, and then
call sunset (a separate method!) to make the sun go down.
You will find this code:
private Square wall;
private Square window;
private Triangle roof;
private Circle sun;
You need to add a line here for the second sun,
For example: private Circle sun2;
Then write the appropriate code for creating the second sun.
Exercise 3: Close the picture project, and open the lab-classes project.
This project is a simplified part of a student database designed to keep track of students in laboratory classes and to print class lists.
Create an object of class Student. You will notice that this time you
are not only prompted for a name of the instance, but also for some
other parameters. Fill them in before clicking Ok. (Remember that
parameters of type String must be written in double-quotes.)