If you randomly choose an answer to this question from the options provided, what is the chance that you'll choose the correct answer?
A) 25%
B) 50%
C) 0%
D) 25%
(H/T Shamus Young)
Showing posts with label pop quiz. Show all posts
Showing posts with label pop quiz. Show all posts
Monday, October 31, 2011
Wednesday, May 20, 2009
Programming Quiz of the Day/Week/Month.
Question 1: What is the value of x after this code executes?
dim j as integer, x as integer
j = 5
x = (-1 ^ (j - 1))
Question 2: What mathematical law does the following code implement?
'Globals
dim i as integer, j as integer
dim dValues() as double
Private Function DoEet() As Double
i = UBound(dValues)
For j = 1 To i + 1
DoEet = DoEet + RecursiveHell(-1, 0, -1, 1)
Next j
End Function
Private Function RecursiveHell(k As Integer, l As Integer, _
m As Integer, x As Double) As Double
Dim temp As Double
If k = -1 Then
k = 0
RecursiveHell = RecursiveHell + RecursiveHell(k, 1, k, 1)
Else
If l < j
Do While m < i - (j - 1)
temp = x * dValues(m)
RecursiveHell = RecursiveHell + RecursiveHell(k, l + 1, m + 1, temp)
m = m + 1
Loop
Else 'l = j
Do While m < i
temp = x * dValues(m) * ((-1) ^ (j + 1))
RecursiveHell = RecursiveHell + temp
m = m + 1
Loop
End If
End If
End Function
(Might want to resize your browser so that this fits on one line:)
-----------------------------------------------------------------------------------
(Don't know what recursion is? Click here to find out.)
Wednesday, May 14, 2008
Pop Quiz: C++
What is special about this function?
What is special about this function?
inline void foo(DWORD &a, DWORD &b)
{
if( a != b ) a ^= b ^= a ^= b;
}The first correct answer earns an imaginary bag of marshmallows!
Saturday, March 22, 2008
Pop Quiz!
And you thought you were safe on the weekend. Diagram the following sentences:
And you thought you were safe on the weekend. Diagram the following sentences:
- Dave likes chocolate.
- The horse raced past the barn fell.
- So I was like walking down the street like and this car like TOTALLY almost ran over this cat like but it was like ok lol.
- The Dutch government has said it fears the same kind of backlash as over the cartoons when a right-wing lawmaker releases a film critical of the Koran, which he says he will do this month online after cinemas refused to show it.
A double imaginary-bag-o-marshmallows to whomever gets them all correct first!
Subscribe to:
Posts (Atom)