|
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
Today we will finish and check off sameDayAs, comesBefore, and nextDay from lab07a—objects as parameters: going on more Dates, including
Practice problem, once you have finished the previous lab:
Inside your project with class Date, create a(nother)
class PizzaServer,
and then paste in a version of that class from a previous lab.
Then, write
whichDayToWork:
/** Which Date does this PizzaServer prefer for their next shift, * given a choice of two upcoming Dates. * @param d1 The first date to consider working on. * @param d2 The second date to consider working on. * @return which Date is preferred for this PizzaServer's next shift. * It will be one of d1,d2. */ |
After a thorough review of the Journals of PizzaServer Psychology, it has been determined that:
If a PizzaServer has a balance of less than $100, then they prefer to work sooner, given two options. Otherwise, they prefer the later date.
As you work through the problem,
pay attention to each step of The Design Recipe,
as detailed in lect07b—Returning objects from methods (pt. I): the design recipe reminded.
You can see a
solution,
along with discussion on various approaches.
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
©2008, Ian Barland, Radford University Last modified 2008.Feb.28 (Thu) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |