| about | help | code help+videos | done | prefs |
/*
* Thanksgiving.java
*
* Write a method int thanksgiving(int year) that takes a year > 1999 and
* returns the day of the month of November on which USA Thanksgiving falls.
*
* @author YOUR NAME HERE
*/
public class Thanksgiving
{
// Precondition: year > 1999
public int thanksgiving(int year)
{
final int YEAR = 2000; // first valid year for this method
final int NOV1 = 3; // 2000/11/01 falls on a Wednesday
final int THURSDAY = 4; // (Sun = 0, Mon = 1, ..., Sat = 6)
return 0; // STUB
}
}
thanksgiving(2000) → 23 thanksgiving(2001) → 22 thanksgiving(2002) → 28 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100
Copyright Nick Parlante 2017 - privacy