English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I really need the code for this program. A function-oriented program that when i enter 10 numbers, i can get the sum,average,another operation is to sort those number from descending to ascending and last function i need is searching array by using linear search. Please help me. Thank you so much.Godbless!!

2007-07-10 13:30:45 · 2 answers · asked by bridjE 1 in Computers & Internet Programming & Design

2 answers

double arr = new double[] { 1.0, 2.0, 3.0 };
// You can handle the input stuff on your own

// =============================
double sum = 0;
for (int i=0; i
// sum stored in sum
// average computed by sum/arr.length

Arrays.sort(arr);

// Now the array is sorted.

// And here's a find method:

int findIdx(double[] arr, double v) {
for (int i=0; i if (arr[i] == v) return i;
return -1;
}

2007-07-10 13:35:31 · answer #1 · answered by McFate 7 · 0 0

Microsoft excell

2007-07-10 20:33:31 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers