Re: yet another how do i ?
public class ArrayAverage{
public static void main(String[] args) {
double nums[]={1.0,2.3,3.4,4.5,40.5};
double result=0.0;
int i=0;
for(i=0; i < nums.length; i++){
result=result + nums[i];
}
System.out.println("Average is =" + result/nums.length);
}
}
Re: yet another how do i ?
Hello Daren,
Though you have mentioned your requirements but you have forget to mentioned in which Programming language you need your Output, because we could expect average with array using JAVA, C# and also with the Excel, so please mention the programming language.
Regards
Re: yet another how do i ?
needs to be in JAVA
the array is populated by input boxes and is in another method
i have 4 methods all together
input for the array
sumArray()
avgArray()
highPrices() <---- i need this one
everytime i do it it says it cant accept more then one type or something like that