This is the archived website of SI 413 from the Fall 2012 semester. Feel free to browse around; you may also find more recent offerings at my teaching page.
Use a separate sheet of paper for your answers! Everything should be submitted in one packet, all printed out for me to see.
In class we talked about "spaghetti code", which is code that uses GOTO statements way too liberally and becomes almost impossible to follow. I want you to write your own example of spaghetti code, in the C++ language.
Submit your code electronically as 413 hw 10
in a file called ex1.cpp
. Your program should compile and run without any arguments or special flags. You also need to submit a description of what your code does, written out and turned in with the other exercises for this assignment.
Grading this problem will consist of me first looking at your code, briefly, and trying to figure out what it does. I will then look at your description of what it actually does and then run it. If your code actually does something, and it's what you describe, but I couldn't discern that by looking at it, then you'll do well on this problem.
It may help to go back and read Dijkstra's original article on GOTOs.
Consider the following very simple class definition in Java:
public class AClass<T> { T x; public AClass() { x = new T(); } }
javac
give when you try to compile this class?Find an open-source software license that is not mentioned in the slides and tell me about it.
If you want to search around, there is a fairly comprehensive list at this link and also see the links from Unit 10.
Specifically, I want to know: