IntegerSign Solution


Category: Tag:



The project name of this exercise is **IntegerSign**.

The purpose of this assignment is for to get practice working with integers, comparison operators, and simple if / else statements.

Problem Description

You are to write a program in which a number is stored in an **IntegerSign** object. You can then ask this object if the number is zero, positive, or negative. The corresponding UML diagram looks like this:

![IntegerSign Class Diagram](/images/IntegerSign-ClassDiagram.png?raw=true)


– Zero is considered positive.

– Use if/**else** statements for some of your tests but if you’re feeling adventurous you can try the conditional operator

Getting Started

Using the techniques shown on the instruction page [How to Start Every Java Project in this Course](, create a new project from the GitHub classroom assignment.

Create the following files in the **src/main/java/edu/sbcc/cs105** folder and add the appropriately named classes to them



Open up each class file and create the class structure. Add the standard header to the file. The template for this header is available at:

**You’ll have to add the proper Javadoc documentation** as well as the proper code to solve the problem. You will have to add instance variables, constants, method stubs, and code to get this class defined properly. Read the comments (and the problem) to understand what the problem is and how you will solve it.

You will need to add test code to **** to test the **** source code.

Once you’ve written your code run the code by right clicking on **** in the file explorer and selecting **Run** from the context menu or using the debug tool from the **Activity Bar**. Examine the output. Does it do what you want? If not, how can you modify the code to do what you want?

Running Unit Tests

Don’t forget to run unit tests before submitting your assignment.

**YOUR UNIT TESTS MUST PASS BEFORE SUBMITTING THE FILE OR YOU GET NOTHING (Reference to the original Charlie and the Chocolate Factory).**

No UML Diagram for the Project

No UML diagram is required for this project as one has been provided for you.

Submitting Your Assignment

Follow the standard instructions for submitting a Java assignment: [How to Submit Assignments]( Once you have submitted your assignment, it is a good idea to check the branches section of GitHub a few minutes later to see if your unit tests passed on the build server (green checkmark is good, red X is bad)