CS170 - Project 2

CS170, Project 2


Due: See class webpage

1. Subrange Sum

A subrange sum is the sum of two or more consecutive integers. For example, 1+2, 4+5+6, 1000+1001+1002+1003, etc, are subrange sums. The output of the program looks something like this when the user enters the integer 1986:
	Enter number = (you enter 1986)
	1986 is the subrange sum of 160..171
	1986 is the subrange sum of 495..498
	1986 is the subrange sum of 661..663
	Done
Check for yourself that:

2. cs170 Project directory

Each student enrolled in this course has a special project directory named cs170 in their home directory. You must work in the project directory to ensure that your work is protected unauthorized access. After you login to the UNIX system, you execute the command ``cd cs170'' to enter your project directory.

3. Help file

To help get you started with this program, I made the file ``pj2.java'' available on this webpage (click on the link). Click on "File" in your Netscape browser and select "Save As". Save a copy in your cs170 project directory. Then use vi (or your favorite editor) to expand it into the solution for this assignment.

This project will use the ConsoleReader class to input integer numbers. You will also need to put a copy of the ConsoleReader.java file in your project directory. You can get a copy of the ConsoleReader.java program at this hyper link: click here. Follow the link above and then click on "File" in your Netscape browser followed by "Save As" to save a copy in your cs170 project directory.

4. Turn in