;;;; Assignment C ;;;; ;;;; File: asstc.txt ;;;; Author: CS 51 (Bob Walton) ;;;; Version: 1 This assignment is designed to teach C syntax to students who already know a programming language (like PASCAL), but who do not know the C language, and who are taking CSCI S-51. The method of this assignment is to have students code and test the C parts of their solutions to assignment 4, and to recode their solutions to assignment 1 in C++ (or more precisely, in C plus a few C++ features). There is no grade for this assignment. But if you have zero experience with C, doing the first C++ assignments will take you about 3-4 extra days, which you will not have. The specific things you MUST do are: (0) Get a C or C++ textbook that does not assume you already know C, and read it. Some possibilities: The C programming language: Brian W. Kernighan and Dennis M. Ritchie, Prentice Hall, QA76.73.C15 K47 1988. On to C, Patrick Henry Winston, Addison-Wesley, QA76.73.C15 W57 1994. These are typically checked out of the library. (1) Write the C functions required for assigment 4 in asst4.cc. Test them by making asst4_test.out. (2) Write the make_symbol and make_integer functions in make_objects.cc, and make print_test.out as a test. Ignore the symbol table: just make new objects all the time. These atoms should be made and printed by the test. (3) Write the part of the `operator <<' function in print_object.cc that prints lists, and make print_test.out as a test. At this point everything should work EXCEPT that since no symbol table is used, == is not equivalent to EQL. (4) Add the symbol table code to make_symbol and make_integer. Note that the way you compare to strings in C is strcmp (x, y) == 0 means x and y are equal Strings are `char *' values; strcmp is a library function that returns -1, 0, or +1 according to whether the first string (x) is less than, equal to, or greater than the second string (y) in lexical ordering. Test by making eql_test.out. (5) Write my_strcmp in make_objects.cc and replace your call to strcmp with a call to my_strcmp. Test by making eql_test.out. (6) Write the functions in functions.cc one at a time. Test by making functions_test.out. You may find you reach the point of diminishing returns where you are not learning much more C with each new function your write, in which case you can stop.