For assignments, is it okay to validate that our program works on a UK
Linux virtual machine or should I still check it on the multilab?
It should suffice to check on any Linux machine.
I plan on creating my files in VSCode, but I am unsure about
how the testing process would work for the MultiLab.
My suggestion is to copy your source code (.c,Makefile) to a directory
in your MultiLab account and compile and run the code there to make sure
it works. I don't know how well VSCode will integrate with the
random-number generator component of the assignment.
Will we need to install a compiler and a text editor on our MultiLab
account? I tried running a C++ program but received an error.
No, gcc, g++, and
javac are all there already. Try using the Makefile I provided; it properly calls the compiler.
Several text editors are available; I recommend vim, but there are also pico,xedit,emacs, and nano.
Is there a way to pipe into stdin using randGen.pl and run with
parameters in gdb?
What I do is run
./randGen 42 1000 | head -1000 > rand.data
to get 1000 lines of random data, and then in gdb:
(gdb) run 4 50 2 < rand.data
to pipe the data in. Gdb doesn't allow pipes, but
it does allow redirection like this.
Program 1
I only have one .cpp file with all my code for the source code in it
(node structure, header structure, methods and main function). I have
them organized into groups so that it flows correctly but all the code
is still in one file. Would this be sufficient for submitting, or
should I try to separate the node and header structure and functions
into separate .cpp files and tie them together.
One file is OK, so long as the structure is clear and modular.
In my code, there are spots where I believe I can improve the time
efficiency, but have not gotten around to improving them yet. If I
were to submitted it currently in its slightly inefficient state,
would that lose points on the overall project.
Unless it is extremely inefficient (such as O(n²) time for computing
the value of a train), it's OK. Clarity is more important than
efficiency.
May I use an array of all the trains?
Yes.
Program 2
Should there be a set of parentheses in the output around the entire tree?
No, there should not. workingTernary
agrees with the assignment statement: no overall parentheses.
Program 3
May we use C++ vectors?
Starting with Assignment 3, you may use C++ vectors.
When we are finding the median of our data for the partitioning, how
we should find the median if we have an even number of points? Should
we just take the lower value of the two middle points?
Average the two middle values.
May the points within buckets be listed in an order different from the
order in the working program?
Yes, that's not a problem so long as the set of points agrees.
What is the command we are supposed to run for the output to submit?
Sorry; I have fixed the assignment page. Please run it on
randGen.pl 43 1000 | kd 3 64 10
Which method of median calculation
will be graded if there is an even number of values? Selecting the
lower of the two or averaging?
Either is OK; document your choice.
Program 4
The working program treats o'er as o and er.
Should ours do the same?
My program is correct. Once you remove punctuation, o'er becomes two
words: o and er.
Likewise, can't is two words: can and t.
Does our output need to be exactly like yours for full credit?
It should have the same content. Ties can resolve in a different
direction.
I plan to implement my hash table’s external chaining with C++
vectors. Would that choice be acceptable for this assignment?
Yes.
Program 5
The working program prints , and children. even
when a family does not have any children. Is that correct?
That's expected behavior, although it is pretty ugly.
Is there any case where a family can be updated with the Family command, such as adding a child to the family, or
should a Family command with a family number that has
already been defined immediately send a failure message and move to the next
command?
Families should never be updated. Any attempt to define a family with the
same number as a previously defined family should generate a failure
message and the program should ignore the attempt.
Are we allowed to use the queue standard library while implementing
breadth-first search?
No, you must write your own queue routines.
For our Union algorithm, do we need to the implement the extra
features that try to keep the paths short? (i.e. keeping a length
value in the representative or compressing?)
You should keep a length value in the representative. You don't need to
compress paths.
The workingGenealogy program implements a notification if
two people who are already related are connected in a new family.
The assignment says this feature is extra credit. Correct?