Java Abstract Array Sum Average#9716

Java Abstract Array Sum Average

1 second
128 megabytes
Very easy

Implement abstract class Arr.

Implement class Array that extends Arr.

abstract class Arr {
  int a[]; // array of integers
  int n; // size of array
  abstract int Sum(); // Return sum of array elements
  abstract double Average(); // Return average of array elements
}

class Array extends Arr {
  Array(int n) // Constructor
  int Sum() // Return sum of array elements
  double Average() // Return average of array elements
}

Input

First line contains number . Next line contains integers in the range from to .

Output

Print in one line the sum of array elements and their average.

Examples

Example 1

Loading
Loading