UMBC CMSC 202, Computer Science II, Fall 1999,

Project 1 Questions and Answers


Date: Sun, 19 Sep 1999 20:52:08

>   reviewing my previous projects from 201, i observerd that all of my
> functions concerning prepend, append, insert, or delete all are passed a
> HEADptr. i dont know of any other way to do it, and i highly doubt it
> would be in our C++ book ( i looked and didnt find it). Without changing
> main() , i dont see how you would like me to start composing this
> project. Your response is greatly appreciated and anticipated!

If you study the code that I have supplied, you will see that the head
pointer (along with some other data items) is a global variable, and can
therefore be accessed freely from all functions in ClassList.c.  Although
it is generally not a good practice to use global variables, I have done
this intentionally so that as we convert from C to C++ and add the use of
classes, you will see these global data items become private data items of
a class.  

So based on how I have written the code, it is not necessary to have a
parameter for the head pointer.  Be sure that your functions work with the
main() that I have provided.


Date: Sun, 19 Sep 1999 20:57:30 

> 1. Since we are only completing 4 functions during this project, what kind
> of documentation are you requiring.  I already submitted and I have
> documented the four functions but not anything else.  Also, do I need to do
> a heading for each file submitted?
> 

Every source file gets a header comment.  Within each header (.h) file,
there should be a comment before each function prototype.  Please review
the Project Organization web page. 

> 2.  How do you judge the efficiency of the project?  Mine runs well under
> several tested mains and inputs and I want to know what you are looking for
> as far as efficiency.  I don't think I have any memory leaks.
> 

In this project, we will not worry too much about efficiency except that
any glaring inefficiency may be penalized a few points (e.g., traversing a
list mutliple times when one time would suffice.)


Date: Sat, 18 Sep 1999 10:44:51

> Working on my makefile, I wasn't having problems a few days ago, but ever
> since modifying Proj1 (merely copying and pasting code from the class
> webpage), I've had problems doing a "make".  Whenever trying to "make" I
> get an error that the CC command is not found.  I'm confused. 

First of all, for Project 1 you can use the "cc" command (C compiler)
rather than "CC" (C++ compiler), but either should be OK.

If you're getting "command not found" error, the problem is probably not
in your makefile.  One possibility is that you are connecting to the Linux
machine rather than an SGI machine.  Are you using telnet?  If so, telnet
to irix.gl.umbc.edu rather than gl.umbc.edu.  


Date: Thu, 16 Sep 1999 10:58:27

> I was just wondering during lecture you said comments and descriptions are
> generally in the .h or .H files. does that mean that .c or .C files are
> generally comment free. I am just wondering b/c if we start commenting the
> .c files they tend to get real cluttered 

Some programmers may choose to put function documentation in both the .H
and .C files, but as you point out, this may be overkill.  The preferred
place for the description of the function, parameters, etc. is in the
header file.

That doesn't mean the .C file would be "comment-free".  Within the
function body, the following rules-of-thumb alway applies:
Put a comment on any statement that might be hard for the reader to
understand.  Use comments to separate the major parts of a function.
Use comments to explain the purpose of a variable when that is not
obvious from the variable's name.


Date: Thu, 9 Sep 1999 10:30:11 

> May I assume that for this program, idNum does not need to be in
> order?  If I do not have to search for the proper order this function
> will be very easy to code.
> 

There is no assumption or requirement at this point that the nodes in the
list are kept in any special order.  The ordering of the nodes will be
dictated by the order in which they are prepended, appended, or inserted.


> May I also assume that since its always going into position 2, that
> I will not need to code for the event the insert is thefiiirst and/or
> record?
> 

You should absolutely NOT make this assumption.  Position 2 has been
hard-coded in my main(), but there is certainly the exectation that the
Insert() function will work for any valid position.  You should write your
own main() to verify that it does.


> *  If you DO want checks for first/last/only, may I then pass the
> record into the append or prepend functions?
> 

It would make sense to do that, since it would probably eliminate
duplicating code.


Last Modified: 20 Sep 1999 17:15:23 EDT by Alan Baumgarten, abaumg1@cs.umbc.edu

Back up to Fall 1999 CMSC 202 Section Homepage