CSCI.UA0101: Homework 2

Section 001 (Honors): 50 points Section 002: 40 points + 10 bonus Updates: 3.17 and 4.34 are not checkable on livelab. 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: - use good variable/function names (self-documenting code) - avoid hardcoding values - provide comments for complex code blocks For more details regarding good coding style guidelines see the grading criteria.

Exercise 1 - LiveLab Exercise 3.17 (Game: rock, paper, scissors)

Points: 10 Complete programming exercise 3.17 from the text. Save and submit your program (just the source code) as Exercise03_17.java.

Exercise 2 - LiveLab Exercise 4.1 (Count positive and negative numbers and compute the average of numbers)

Points: 10 Complete programming exercise 4.1 from the text. You can check your code correctness on LiveLab before submitting your code on NYU Classes. Save and submit your program (just the source code) as Exercise04_01.java.

Exercise 3 - LiveLab Exercise 4.9 (Find the two highest scores)

Points: 10 Complete programming exercise 4.9 from the text. You can check your code correctness on LiveLab before submitting your code on NYU Classes. Save and submit your program (just the source code) as Exercise04_09.java.

Exercise 4 - LiveLab Exercise 4.15 (Display the ASCII character table)

Points: 10 Complete programming exercise 4.15 from the text. You can check your code correctness on LiveLab before submitting your code on NYU Classes. Save and submit your program (just the source code) as Exercise04_15.java. Hint: Use a 'char' data type and update that char value as your iterator.

Exercise 5 - LiveLab Exercise 4.34 (Game: rock, paper, scissors - Best 2 out of 3)

Points: 10 (Required for Honors students; bonus for regular students) Complete programming exercise 4.34 from the text. Save and submit your program (just the source code) as Exercise04_34.java.