main
March 27th, 2017    

CIS 26 2543 ET6
Main
Files
Syllabus
Links
Homeworks


Notes
0001

PDFs
Intro
20090901
LinkedLists
20090908
20090915
Trees
20090922
Inheritence
20091006
20091013
20091013-quiz-pdf
20091013-quiz-doc
20091020
20091020-quiz-pdf
20091020-quiz-doc
20091103
20091110
20091117
20091124
20091201

Homeworks

HW1: Write a ``Hello World'' program. Obviously this homework isn't `just' about the hello world program. It's about downloading Java SDK, from http://java.sun.com, installing it, setting up your environment (ie: path), and then being able to compile and run the simple Hello World program.


HW2: Implement an Array based list (ability to add/remove objects from beginning/end of the list).


HW3: Implement a Linked List, with same functionality as Array based list from HW2 (ie: ability to add/remove Objects from beginning/end of the list).


HW4: For both array list and linked list imlement the ``splice'' methods. Your splice should be functionally similar to: http://www.perl.com/doc/manual/html/pod/perlfunc/splice.html Also test the code. Note that you don't need to use anything other push and pop methods for that.


HW5: Write an applet (or an application) that lets users draw rectangles. The user should be able to click on the screen, drag the mouse as they're drawing a rectangle. More details in class.


HW6: Fix the code we created in class, 20091013. The "CarApplet.java" file has a bug somewhere around ``// move victim away'' [comment] code. Specifically, make the dot always run away from the car---as it is, it stops running when it hits the edge of the screen. [your first task is to figure out why this problem is happening, and your second task is to fix it].

Also, there's a take home quiz: CIS26_20091013_quiz.pdf. It must be submitted (in paper form) in class on 20091020. No late quizes will be accepted.


There's a take home quiz: CIS26_20091020_quiz.pdf. It must be submitted (in paper form) in class on 20091027. No late quizes will be accepted.


HW7: Find a book chapter or a website (google) that has examples of Socket programming in Java. Compile and test the sample client and sample server code that they provide. Submit that code. Note that the basic code should be ~20 lines long for client and server---don't search out anything too complicated.


HW8: Write a web page grabbing program in Java. Your homework will accept a URL at command line, ie:
java PageGrabber http://www.google.com/
Your program should use the java.net.Socket class to connect to the server, send ``GET / HTTP/1.0\n\n'', and then dump whatever it recieves back to standard output (which will be the HTML for the page).


HW9: Write a very simple web-server. This will be the reverse of what you did in HW8: your program will wait for a connection, when it gets ``GET / HTTP/1.0\n\n'', it will dump the contents of ``index.html'' as the output. Take a look at: http://www.theparticle.com/cs/bc/perl/notes0010.html for what a valid response (and request) looks like.


20pts EXTRA CREDIT FOR MIDTERM: Create a MyPriorityList, by extending MyList code we had in class (ie: array based list, with push, pop, shift, etc.). The idea is to implement priority queue using a *heap* implementation. The methods you will override are: push, shift. The shift method will remove the smallest element (and adjust heap). Push will add the element to the list (add to end, then adjust heap). The reason for the heap is so push & shift take lg(n) time: you'll be able to use your PriorityList for sorting---simply insert any N numbers, and shift them out (having the sort take n lg(n) time). Your code will implement code described here: http://en.wikipedia.org/wiki/Binary_heap A very good introduction is in http://cg.scs.carleton.ca/~morin/teaching/5408/refs/minmax.pdf Note: your heap should assume all inserted objects are of Comparable type.


NOTE: Submit all homeworks by December 15th, 2009.



































© 2006, Particle