CSC175 Intermediate Programming
Spring 2019
Homework 2


If you have the older edition (Updated edition), click here. If you have the 3rd edition, click click here.

Otherwise, if you have the 2nd edition:

Chapter 2 (Principles of Programming and Software Engineering): Self-test Exercises 1, 2* (page 108), Exercises 4, 6, 8, 11 (pages 109 - 110), implement your solution to exercise 11 and test it using JUnit ; your tests should include both normal (expected) and alternate (unexpected) inputs; hand in the source code of your class to be tested + the JUnit test class, as well as a screen snapshot showing that your JUnit tests passed. Follow the documentation and style guidelines as discussed in class and in chapter 1.

* Correction to Self-test exercise 2:
Write specifications for a method that computes the sum of the first five positive integers in an array of N arbitrary integers.

Grading
Self-test exercises 10 points
Exercise 4 10 points
Exercise 6 10 points
Exercise 8 5 points
Exercise 11 - loop invariant 5 points
Exercise 11 - correctness of implementation 15 points
Exercise 11 - correctness of tests + screen snapshot showing all tests passed 15 points
Exercise 11 - choice of tests 15 points
Exercise 11 - documentation/style for class to be tested + JUnit test class 15 points

The assignment should be done individually.


[Back to the Assignments Index]