This is the first graded lab for CS2102. You will be graded by your ability to make progress on the primary task. Note that this is the advanced lab.
If you are in the Lab, perform the routine KH 202 setup or AK 120D setup; for now, ignore the "advanced setup" options. If you would like to set up Eclipse on your personal computer, then (a) install Java JDK 1.5 if you need to as described in tools section (here); and (b) install Eclipse as described in tools section (here).
Design a program where the user enters a set of integers and you output a permutation of these numbers such that all the negative elements (if any exist) precede all the positive elements (if any exist). Note that a negative integer is an int ≤ -1 while a positive integer is an int ≥ 1.
Review the design recipe we have been following. Design questions to be answered:
Note: do not go out of your way to describe every possible form of input. If you only considered one form, then state that. Don't invent spurious alternatives that were never really taken seriously.
Create a class AdvancedLab1 in the package defined by your CCC unix name.
Given a scanner constructed from System.in, you can read the next integer simply by invoking the nextInt() method call. Refer to the class examples, and the book (Section 2.2, pp. 78)
Your goal is to turnin the assignment file (AdvancedLab1.java) by November 1st at 11:59 PM. The name of the assignment you should use is "lab1".
Date | Reason/Change |
10/16/06 | Initial Page |