Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In today’s practical, you will have the opportunity to explore some of the concepts
- covered in the week 1 lectures. You should read through the tasks before beginning as
- they are directly related.
- 1. Write a program called RaceReport, which gets data from 2 Athletes (via
- keyboard input) in a race and displays a report indicating the winner of the
- race.
- 2. Define an Athlete class to facilitate the above. The Althlete class should
- contain the name of the runner and the time taken to complete the race.
- a. Implement appropriate setter and getter methods in addition to a
- toString method to print out name and time.
- 3. Implement a Name class to store firstName middleName and surName. Write
- appropriate setter and getter methods.
- 4. Modify the Athlete class so that it can accept a Name object in its constructor.
- 5. Create a class called LongerJumper which extends from Athlete. As part of
- the constructor include jumpDistance.
- 6. Include a toString method in task 5, above, to printout the jumpDistance and
- other other Athlete variables.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement