package Algorithms;
public class ArrayFindmax {
public static void main(String[] args) {
double[] a=new double[]{14.0,58.0,56.0,58.0,888.0};
System.out.println(ArrayFind(a));
System.out.println(ArrayAverager(a));
System.out.println(b);
}
public static double ArrayFind(double[] a)
{
double max=a[0];
for(int i=1;i<a.length;i++)
{
if(a[i]>max)
max=a[i];
}
return max;
}
public static double ArrayAverager(double[] a)
{
double sum=0.0;
for(int i=0;i<a.length;i++)
{
sum+=a[i];
}
double averager=sum/a.length;
return averager;
}
public static double[] ArrayCopy(double[] a)
{
double[] b=new double[a.length];
for(int i=0;i<a.length;i++)
{
b[i]=a[i];
}
return b;
}
public static double[] Reverse(double[] a)
{
for(int i=0;i<a.length/2;i++)
{
double temp=a[i];
a[i]=a[a.length-i];
a[a.length-i]=temp;
}
return a;
}
}