fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. public class Collection{
  9.  
  10. public static String week[] = { "monday", "tuesday", "wednesday",
  11. "thursday", "friday", "saturday", "sunday" };
  12. public static int number[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273,
  13. 304, 334 };
  14.  
  15. public static boolean leap(int rok) {
  16. return ((rok % 4 == 0 && rok % 100 != 0) || rok % 400 == 0);
  17. }
  18.  
  19. public static int dayN(int day, int month, int year) {
  20. int dayYear;
  21. int a, b, c;
  22. int result;
  23. dayYear = day+ numberDay[month- 1];
  24. if ((month > 2) && (leap(year) == true))
  25. dayYear++;
  26. a = (year - 1) % 100;
  27. b = (year - 1) - a;
  28. c = a + (b / 4);
  29. d = (((((b / 100) % 4) * 5) + c) % 7);
  30. d += dayYear - 1;
  31. d %= 7;
  32. return f;
  33. }
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:8: error: class Collection is public, should be declared in a file named Collection.java
public class Collection{
       ^
Main.java:23: error: cannot find symbol
        dayYear = day+ numberDay[month- 1];
                       ^
  symbol:   variable numberDay
  location: class Collection
Main.java:29: error: cannot find symbol
        d = (((((b / 100) % 4) * 5) + c) % 7);
        ^
  symbol:   variable d
  location: class Collection
Main.java:30: error: cannot find symbol
        d += dayYear - 1;
        ^
  symbol:   variable d
  location: class Collection
Main.java:31: error: cannot find symbol
        d %= 7;
        ^
  symbol:   variable d
  location: class Collection
Main.java:32: error: cannot find symbol
        return f;
               ^
  symbol:   variable f
  location: class Collection
6 errors
stdout
Standard output is empty