Quiz of the Month: IsDaylightSavingTime() or not?

Question: Given your machine is in Pacific Time (PST) Time Zone, what is MainProgram.GetAnswer so that MainProgram.Test returns true? class MainProgram {     static DateTime GetAnswer()     {          ????     }       static bool Test()     {         DateTime a = MainProgram.GetAnswer();         String actual = String.Format(“DateTime: {0}; IsDaylightSavingTime: {1}”, a, a.IsDaylightSavingTime());         String expected =…

0

Quiz of the Month: Double Trouble

Without compiling and running this program. Can you tell me what the output would be?  class MainProgram {     static void Main(string[] args)     {         double a = Convert.ToDouble(“1.170404”);         double b = Convert.ToDouble(“2.170404”);         double c = Convert.ToDouble(“3.170404”);         double d = Convert.ToDouble(“4.170404”);                 Console.WriteLine((a == 1.170404));         Console.WriteLine((b == 2.170404));        …

24

Answer of the month: Type.FullName

Answer: It will assert. Why:  Well, first of all… there is one big reason why the assert would fire. “t1” refers to something that has to do with the DerviedClass, and “t2” refers to something that has to do with the BaseClass. Good job Barry for noticing it. I agree with Barry, my quiz was…

1

Quiz of the month: Type.FullName

I once had a dev manager who loves puzzles and quizes. During our team meetings, he will write some code on the board and the team would have a competition to see who can spot the mistake first or who can answer a question about the code first. I always enjoyed those quiz. So I…

10