CSC1110 - Week 7 Homework
Instructions
Use the link provided by your professor to access the GitHub repo with the starter code.
This assignment consists of two parts.
Part 1: Class Tracing
Complete Exercise 7.3 (pp. 317). This exercise has you trace a program with multiple objects. The program with explanations can be found on pages 277-278 (Figures 7.2 and 7.3). The code can also be found in the assignment repository. There is an Excel file in the repository to use for the tracing.
Part 2: Method-call chaining
In the GitHub starter code, skeletons for the Time and TimeDriver class have been provided. Replace the < insert ...> lines with your own code such that the program operates properly. More specifically:
- In the
Time
class, provide a method definition for thesetHours
method such thatsetHours
can be called as part of a method-call chain. - In the
TimeDriver
class, provide a single statement that chains calls to thesetHours
,setMinutes
,setSeconds
, andprintTime
methods. Use reasonable values for your method-call arguments. If you pass 8 tosetHours
, 59 tosetMinutes
, and 0 tosetSeconds
, then your method-call-chaining statement should print08:59:00
Submission Instructions:
Add DONE to the README and then Commit and Push your code to GitHub Classroom.