Add three integers and report the sign of the sum I am in my first high school programming course; the assignment is:


  Write a program that asks the user to input three integers and outputs
  a message indicating their sum and whether it is positive, negative,
  or zero. You should create 2 classes to run this program. One class
  contains all of the procedures for your program and the other has all
  of the procedure calls for your program.


I have done exactly what the assignment has asked for me to do; I was wondering if there was anything that I should change to make my code more simple and or more elegant or point out anything that might lead up to errors, since I'm in my first programming course. I really want to start programming with simple elegant code and not messy code, because I feel like it starts good habits for me later on.


import java.util.Scanner;

class ConorsList {
    int total;


    public void add(int number) {
        this.total = this.total + number ;       
    }

    public void status(){
        if(this.total&lt;0) {
                System.out.println("The sum is negative.");
        } else if (this.total&gt;0) {
                System.out.println("The sum is positive");
        } else {
               System.out.println("The sum is equal to zero");
        }
    } 

    public void status(int total){
        if(total&lt;0) {
                System.out.println("The number is negative.");
        } else if (total&gt;0) {
                System.out.println("The number is positive.");
        } else {
               System.out.println("The number is equal to zero.");
        }
    } 
}

public class Class1_2 {

   public static void main(String args[]) {
       ConorsList list = new ConorsList();
       Scanner fromKeyboard = new Scanner(System.in);

       int amount = 3;

       for (int n=0; n&lt;amount; n++) {
           int x =fromKeyboard.nextInt();
            list.add(x);
            list.status();
            list.status(x);
       }

   }

}
```
Use shorthand for addition, multiplication, division etc.

E.G instead of this.total = this.total + number;

do: this.total += number;

You have a lot of code repetition with these two methods. Anytime you copy &amp; paste, you should be asking yourself if you can make the code shorter.

With your overloaded method, it's easy. Just change your no-arg constructor to call the other:

public void status(){
    status(this.total);
} 


You may also want to change the name to printStatus. You can further reduce the code, since all of the if statements print a lot of the same characters 

E.G:

public void status(total){
    String status = "The sum is ";

    if(total&lt;0) {
            status += "negative.";
    } else if (total&gt;0) {
            status += "positive";
    } else {
           status += "equal to zero.";
    }

    System.out.println(status);
}