0
can i have a good sudgestion to you guys. for those who have knowledege in java..i dont know how to start it
the situation is.. the user need to input numbers10 times... and the program must show the lowest values in those 10 inputs. pls help..
3 Réponses
+ 1
store the inputs in an array then implement bubble sort then return the first value after the sort .....array[0]
0
i think thats the bes way, but im just a newbie in java.. i dont know what you said,
i only know in java is. the if condition, the loops, the and switch statement... i still dont kniw how to use arrays.
0
Lesson about arrays:
https://www.sololearn.com/learn/Java/2148/?ref=app
Initialize an int array:
int[] arr = new int[10];
This creates an array with size 10. The index starts at 0 and at 9 (arr.length - 1).
With a for loop fill the array:
for(int i = 0; i < arr.length; i++){
arr[i] = input;
}
Read the lesson about user input.
https://www.sololearn.com/learn/Java/2220/
You can also create an array like this:
int[] arr = {1,2,3,4,5,6,7,8,9,10};
With a for loop search for the lowest value.