Assignment 1 Solutions
Part of
the homework for 22C:112, Spring 2009
|
Question: The transparency of the macro extension language of Microsoft Excel was quite deliberate. Why would a word user want access to the full power of Visual Basic from within a Excel spreadsheet? (0.5 points)
For example, to compute the value of one cell in the spreadsheet used to fill out a tax form, it might need to open the file holding the appropriate tax table with a file name determined by the cells giving the taxpayer's filing status, and then run some application on that file in order to find the taxpayer's effective tax rate. On completing filling out the spreadsheet, it might need to open a connection to a server and then upload the result of the completed spreadsheet, formatted not as a Excel document, but in a form required by the IRS.
a) What was the name of the timesharing system that was the predecessor of Multics at MIT?
CTSS, the Compatible Timesharing System
b) Why did Bell Labs quit the Multics project?
The Multics project failed to deliver a useful system in a reasonable amount of time. In effect, Bell Labs wanted a faster return on their investment than the project was able to deliver.
c) What came of the effort to port Multics to the Intel x86 family?
d) What was the last Multics site?
"Nothing much came of it."
e) How is Multics related to the modern idea of an ISP?
The idea of a multiple access computer (project MAC stood for this) remains central to the idea of an ISP today.
#include <stdio.h> int fib(int i){if(i<=1){return i;}else return fib(i-1)+fib(i-2);}int main(){int i; for(i=1;i<= 10;i++){printf("fib(%d)=%d\n",i,fib(i));}}
a) Fix it so it conforms to the recommended style. (0.5 points)
#include <stdio.h> int fib( int i ) { if ( i <= 1 ) { return i; } else { return fib( i - 1 ) + fib( i - 2 ); } } int main() { int i; for (i = 1; i <= 10; i++) { printf( "fib(%d)=%d\n", i, fib( i ) ); } }
b) It needs a main program to test it. Write a C main program that calls fib(i) for values of i from 1 to 10. Include this main program with your improved answer to part a. You need not run it, but of course, running it is a good way to make sure your code is correct. Grading, however, depends on more than correctness. Your code should conform to the style required. (0.5 points)
See above! On proper formatting, the main program turns out to be there.
c) It's not object oriented. Comment on the value, in terms of clarity and readability, of the changes you would have to make to this code to make it into legal Java or C#. (0.5 points)
The additional code required to make this program conform to the conventions of object orientation add gratuitous classes and objects to the code. If anything these additions detract from the readability of this code.