Objective:
                      This lab was really frustrating because it was not working, but finally i figured out what i was doing wrong and fix the problem. It was a challenge because it had a lot of stuff to add, plus i had to use to different files. Once this the code of overloading and the other one to display the output. I’m finally done with this lab.

CODE:

NumberStats:

 
package lab3;

public class NumberStats {
	public static void main (String[] args){
	}
	private int firstnumber;
	private int lastnumber;
	private int maximum;
	private int minimum;
	private int count;
	private double average;
	private int totalsum;
	private int value;

	public int getvalue(){
		return value;
	}
	public int getfirstnumber() {
		return firstnumber; } 

	public int getlastnumber() {
		return maximum; }

	public int getminimun() {
		return minimum; }

	public int getmaximum(){
		return lastnumber; }

	public int getcount(){
		return count++; }	

	public double getaverage(){
		return average; }	

	public int gettotalsum(){
		return totalsum; }

}

TrainStats:

package lab3;
import java.util.Scanner;
public class lab3 {

	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);

		int value = 0; // It will do the job for us
		int firstnumber = 0; // This will show the first number entered
		int lastnumber = 0; // This will show the last number entered
		int count = 0;// It will count
		int minimum = 0; // This will show the minimum number entered
		int maximum = 0; // It will show the maximum number entered
		int totalsum = 0; // It will add the numbers entered
		double average = 0 ; // It will show the average

		while (true)
		{
			System.out.print("Input Number, type 0 to get result: ");
			value = input.nextInt();
			totalsum += value;

			if (value >= maximum){
				maximum = value;
			}
			if( value == 0 ) break;

			if (value == minimum ){	
				minimum = value;

				lastnumber = value;

			}
			count++;
			if(count==1){
				firstnumber=value;
				minimum = value;
			}

			if (count>0){
				lastnumber = value;
			}
		}
		System.out.printf("First Number entered = %d\n", firstnumber);
		System.out.printf("Last Number entered = %d\n", lastnumber);
		System.out.printf("Count = %d\n", count);
		System.out.printf("Maximum = %d\n", maximum);
		System.out.printf("Minimum = %d\n", minimum);
		System.out.printf("Average = %d\n", totalsum/count);
		System.out.printf("Total Sum = %d\n", totalsum);

		NumberStats mystats1 = new NumberStats();
		NumberStats mystats2 = new NumberStats();
		NumberStats mystats3 = new NumberStats();
		NumberStats mystats4 = new NumberStats();
		NumberStats mystats5 = new NumberStats();
		NumberStats mystats6 = new NumberStats();
		NumberStats mystats7 = new NumberStats();
		NumberStats mystats8 = new NumberStats();

		System.out.printf("%s\n" , mystats1.getmaximum());
		System.out.printf("%s\n" , mystats2.getminimun());
		System.out.printf("%s\n" , mystats3.getaverage());
		System.out.printf("%s\n" , mystats4.getlastnumber());
		System.out.printf("%s\n" , mystats5.getfirstnumber());
		System.out.printf("%s\n" , mystats6.getvalue());
		System.out.printf("%s\n" , mystats7.gettotalsum());
		System.out.printf("%s\n" , mystats8.getcount());	
	}	
}