CSCI.UA0101: Homework 4

Section 001 (Honors): 45 points
Section 002: 35 points + 5 bonus

Updates: None

Instructions:
Answer the questions stated in the following exercises by submitting plain-text or Java source code (.txt and .java extensions respectively) as stated in the exercises through NYU Classes. No word (.doc/.docx/etc.) or rich-text (.rtf) files please (in your text editor do "Save file as plain-text"). Java programs should be just the Java source code (not your .class files or Eclipse workspaces) unless otherwise stated.

In all files submitted include a documentation header using comments which include:

/**
 * [Description of the program]
 * @author: [Your Name]
 */

Points will be deducted for bad coding style (up to 25% of your grade), so:

For more details regarding good coding style guidelines see the grading criteria.

Part 1

15 points

Complete programming Exercise 6.15 (Eliminate duplicates) from the text. You can check your code correctness on LiveLab before submitting your code on NYU Classes.

Save and submit your source code on NYU Classes as Exercise06_15.java.

Part 2

20 points

Complete programming Exercise 6.21 (Game: bean machine) from the text.

Save and submit your source code on NYU Classes as Exercise06_21.java.

Note: This game is similar to the plinko game.

Part 3

Required for honors students - 10 points
Bonus for regular students - 5 points

Complete programming Exercise 6.31 (Merge two sorted lists) from the text. You can check your code correctness on LiveLab before submitting your code on NYU Classes.

Save and submit your source code on NYU Classes as Exercise06_31.java.

Hint: No java libraries can be used. You probably want to have an index into each list.