login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Datums laten uitkomen

Offline Jimbo - 13/11/2011 14:39
Avatar van JimboLid Hallo,

Ik ben bezig met een vooropgestelde code waarbij verschillende methods extra zouden moeten geschreven worden én de uitkomst natuurlijk True van is. Vooropgestelde code is(én mag niet veranderd worden):
  1. Module DatumsOproepen
  2. Sub Main()
  3. Console.WriteLine(GetDayOfYear(2011, 1, 1) = 1) ' Assertion should be True.
  4. Console.WriteLine(GetDayOfYear(2011, 1, 2) = 2) ' Assertion should be True.
  5. Console.WriteLine(GetDayOfYear(2011, 1, 31) = 31) ' Assertion should be True.
  6. Console.WriteLine(GetDayOfYear(2011, 2, 1) = 32) ' Assertion should be True.
  7. Console.WriteLine(GetDayOfYear(2011, 3, 1) = 60) ' Assertion should be True.
  8. Console.WriteLine(GetDayOfYear(2011, 5, 8) = 128) ' Assertion should be True.
  9. Console.WriteLine(GetDayOfYear(2011, 10, 13) = 286) ' Assertion should be True.
  10. Console.WriteLine(GetDayOfYear(2011, 12, 31) = 365) ' Assertion should be True.
  11. Console.WriteLine(GetDayOfYear(2012, 3, 1) = 61) ' Assertion should be True.
  12. Console.WriteLine(GetDayOfYear(2012, 5, 8) = 129) ' Assertion should be True.
  13. Console.WriteLine(GetDayOfYear(2012, 10, 13) = 287) ' Assertion should be True.
  14. Console.WriteLine(GetDayOfYear(2012, 12, 31) = 366) ' Assertion should be True.
  15.  
  16. '
  17.  
  18. Console.WriteLine(GetDaysInYear(1900) = 365) ' Assertion should be True.
  19. Console.WriteLine(GetDaysInYear(1901) = 365) ' Assertion should be True.
  20. Console.WriteLine(GetDaysInYear(1904) = 366) ' Assertion should be True.
  21. Console.WriteLine(GetDaysInYear(1996) = 366) ' Assertion should be True.
  22. Console.WriteLine(GetDaysInYear(1999) = 365) ' Assertion should be True.
  23. Console.WriteLine(GetDaysInYear(2000) = 366) ' Assertion should be True.
  24. Console.WriteLine(GetDaysInYear(2001) = 365) ' Assertion should be True.
  25. Console.WriteLine(GetDaysInYear(2004) = 366) ' Assertion should be True.
  26.  
  27. '
  28.  
  29. Console.WriteLine(GetDayOfWeek(1, 1, 1) = "Monday") ' Assertion should be True.
  30. Console.WriteLine(GetDayOfWeek(1, 1, 2) = "Tuesday") ' Assertion should be True.
  31. Console.WriteLine(GetDayOfWeek(1, 1, 3) = "Wednesday") ' Assertion should be True.
  32. Console.WriteLine(GetDayOfWeek(1, 1, 4) = "Thursday") ' Assertion should be True.
  33. Console.WriteLine(GetDayOfWeek(1, 1, 5) = "Friday") ' Assertion should be True.
  34. Console.WriteLine(GetDayOfWeek(1, 1, 6) = "Saturday") ' Assertion should be True.
  35. Console.WriteLine(GetDayOfWeek(1, 1, 7) = "Sunday") ' Assertion should be True.
  36. Console.WriteLine(GetDayOfWeek(1, 1, 8) = "Monday") ' Assertion should be True.
  37. Console.WriteLine(GetDayOfWeek(2, 1, 1) = "Tuesday") ' Assertion should be True.
  38. Console.WriteLine(GetDayOfWeek(3, 1, 1) = "Wednesday") ' Assertion should be True.
  39. Console.WriteLine(GetDayOfWeek(4, 1, 1) = "Thursday") ' Assertion should be True.
  40. Console.WriteLine(GetDayOfWeek(5, 1, 1) = "Saturday") ' Assertion should be True.
  41. Console.WriteLine(GetDayOfWeek(2011, 11, 11) = "Friday") ' Assertion should be True.
  42. Console.WriteLine(GetDayOfWeek(2011, 11, 27) = "Sunday") ' Assertion should be True.
  43. Console.WriteLine(GetDayOfWeek(2011, 11, 28) = "Monday") ' Assertion should be True.
  44. Console.WriteLine(GetDayOfWeek(2012, 1, 1) = "Sunday") ' Assertion should be True.
  45. Console.WriteLine(GetDayOfWeek(2012, 3, 1) = "Thursday") ' Assertion should be True.
  46. '
  47. Console.WriteLine(IsOnSunday(1, 1, 7)) ' Assertion should be True.
  48. Console.WriteLine(IsOnSunday(2011, 11, 27)) ' Assertion should be True.
  49. Console.WriteLine(IsOnSunday(2012, 1, 1)) ' Assertion should be True.
  50. Console.WriteLine(Not IsOnSunday(1, 1, 1)) ' Assertion should be True.
  51. Console.WriteLine(Not IsOnSunday(2011, 11, 11)) ' Assertion should be True.
  52. Console.WriteLine(Not IsOnSunday(2011, 11, 28)) ' Assertion should be True.
  53. Console.ReadLine()
  54. End Sub
  55. End Module


Kan er iemand voor dit enige methodes schrijven?

Bedankt!

3 antwoorden

Gesponsorde links
Offline MiST - 13/11/2011 16:01
Avatar van MiST Lid Serieus? Volgens mij hoort dit schooigedrag niet thuis op sitemasters. En zeker niet in dit forum, post het dan tenminste in "samenwerken".
Offline pijke - 13/11/2011 16:26
Avatar van pijke Gouden medaille

Lid
Idd, samenwerken.
Offline Koen - 13/11/2011 16:35
Avatar van Koen PHP expert Inderdaad MiST.
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.206s