Due by 11:59pm 09/29/2010
Write a program to compute and output the number 42 (which according to Douglas Adams' well-known novel is the answer to the ultimate question of life, the universe, and everything) according to the following requirements:
- You may write the program in C, Java, or an interpreted language such as Ruby or Python.
- The program takes a positive integer N as the command line input.
- It then computes 42 in exactly N steps, e.g., could be adding 42.0/N each step.
- The program must *not* use a loop (hint: the only other choice is recursion).
- When compiling your program (if using C or Java), instruct the compiler not to optimize. E.g., "gcc -O0 program.c".
Compute the meaning of life first in 10 steps and then in 100,000 steps. Submit a report under project_code/meaning_of_life/user_id/ with the following:
- Commands for (compiling and) running your program;
- Output from two executions (N=10 and N=100000);
- Your program.
The submission deadline is midnight (11:59pm) Wednesday, October 6.