Difference: CSC121S2024Lab05Hint1 ( vs. 1)

Revision 12024-02-06 - CathyBareiss

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="CSC121S2024Lab05"

Algorithm hint for displayMonth method

  • get the number of days in a month (from another method) (numDays)
  • display the title of the month (using another method)
  • display the spaces for the missing days of the month (using another method)
  • first day of the current week (first week) is 1 (firstDay)
  • last day of the current week (first week) is 7 - starting day (lastDay)
  • while the last day of the week is < the last day of the month (lastDay, numDays)
    • display that week (using another method)
    • add seven days to both of the variables (firstDay, lastDay)
  • display the remaining partial week (first day of current week to number of days in the month) (firstDay, numDays)
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback