Homework H1. Program correctness (OLD VERSION OF COURSE!)

We ask that you to watch 20 minutes of videos on the topic of program correctness and then do a short homework. The homework is due in the CS handback room, Gates 216, by 4PM on Friday, February 19 (or hand it in lecture the day before). The videos are accessible from this course webpage:

www.cs.cornell.edu/courses/CS2110/2016sp/online/assertions/assertions.html

The homework itself, h1.pdf, should not take long. This is the easiest way for you to see and get practice with some important but straightforward material. Please don't wait till the last minute!

We ask that you do it alone. Of course, you can sit with a friend (or friends), watching the videos and discussing them. But a major goal is to get you to practice doing some simple things, and that won't happen if you don't write all the answers yourself.

Assignment A0. Assert statement (OLD VERSION OF COURSE!)

It is for you to do as soon as you get Eclipse working and you have been to recitation 01. Purpose of A0: Get you to use Eclipse and learn about the Java assert statement.

For those of you who are interested, we also have ppt slides with notes (as a pdf) written by Sir Tony Hoare on using assert statements --in many programming languages. Tony is one of the significant people in CS, and if you continue with CS courses, you wiill see his name often and read some of his papers dealing with languages, concurrency, and programming. He is Professor Emeritus at Oxford and just retired as principal researcher for Microsoft. He is the author of Quicksort (which you will see later in 2110) and the creator of Hoare Logic for verifying program correctness.

Here, he gives practical hints on using assert statements. Read especially the notes on pages 14-15 about preconditions and postconditions.

A0 handout    Assert early and assert often (ppt)

Assignment A1. Classes (OLD VERSION OF COURSE!)

The purpose of A1 is to give you practice with developing a class --in this case, one that maintains information about the PhD advisors of a person with a PhD. Along the way, you will practice (1) writing a JUnit testing class, (2) writing assertions for preconditions, (3) writing good method specifications and class invariants and using good conventions in presenting programs, and (4) writing and checking javadoc specifications.

File a1.pdf is the handout for the assignment. The CMS tells you when A1 is due. Get started early.  griesGenealogy.pdf     tateGenealogy.pdf

Assignment A2. Functions (OLD VERSION OF COURSE!)

The purpose of A2 is to give you practice writing java functions, mainly dealing with Strings. We found out in earlier semesters of this course that many students did not practice unless forced to, so we have to give this assignment. The handout is quite short. File A2.java contains lots of instructions as well as the specificaitons and stubs for the functions you have to write. a2handout.pdf    A2.java

Assignment A3. Linked lists (OLD VERSION OF COURSE!)

Assignment A3 introduces you to "linked list", a data structure that allows a list to grow to any size and in which operations like insertion and removal of a value can take place in constant time. You will implement a doubly linked list. A3 handout    DLinkedList.java

Assignment A4. Disease propagation (OLD VERSION OF COURSE!)

Assignment A4 requires you to write 7 methods to process trees in an interesting application. a4.zip

Assignment A5. Connect Four (OLD VERSION OF COURSE!)

Assignment A5 deals with a program to play the game Connect Four. A player can be a human, a random player, or an AI player that uses a miimax algorithm to compute a best move. A5ConnectFour.pdf   a5release.zip. Due date? See the CMS.

Assignment A6. Heaps (OLD VERSION OF COURSE!)

Assignment requires you to implement a min-heap. in which duplicates are not allowed, values and their proprities may be different, and the priority of an existing value may be changed.
a6handout.pdf    a6release.zip   Due date? See the CMS.

Assignment A7. Shortest Paths (OLD VERSION OF COURSE!)

Implement Dijkstra's shortest path al Dijkstra's shortest path algorithm.
a7handout.pdf    a7release.zip Due state? See the CMS.

Assignment A8. (OLD VERSION OF COURSE!)

Temple of Boom! You write methods to explore a cavern underneath the temple, getting an Orb, and hen get out before the cavern collapses, picking up as much gold as possble.
a8handout.pdf    a8release.zip

 

Automated Cheating Detection

We use an automated system that uses sophisticated artificial intelligence techniques combined with program analysis tools to notice unusual similarities between programs turned in by different people. These tools really work and are quite hard to fool. So, while it might seem tempting to borrow a solution from a buddy, change the variable names and comments, or reorder the statements, the tools would be very likely to figure out what you did.

The tool we use, called Moss, was developed by a Cornell PhD, now a professor at Stanford, over 10 years ago.

We take cheating seriously, and cheating with an attempt to cover it up is grounds for failing the course outright. Realistically, it is much easier to just do the assigned problems than to get away with handing in code someone else wrote, because short of rewriting that code completely from scratch, we’ll catch it.

So you’ve been warned: It is difficult to get away with cheating in CS2110. Please do your own work, and talk to an instructor, a TA, or a consultant, as often as needed if you get stuck and need help. We’ll get you back on track.