Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

create a console-based application whose Main() method accepts ten integer values from the user and stores them in an array. Next, create a method that determines and displays the smallest and largest of the ten values. Then, pass the array to the method.

OpenStudy (appleduardo):

its easy. you can convert it to string so we'll get the lenght of the string var which is going to tell us if it's greater than 10 digits or less than. Then with the foor loop you can store each vealue of the string var[i] in each position of the array[i].

OpenStudy (anonymous):

I'd probably do something like declare a lowest and greatest variable and initially store the first element of the array in the lowest variable and in the greatest variable. Then I'd traverse the array, comparing each successive element against the value currently stored in lowest and greatest. if array[i] < lowest then lowest = array[i] (and something similar for biggest, but comparing greater than). I'm going to assume you are fine with the mechanics of getting the user input into the array (probably some version of a loop and maybe something with a Scanner object if you are in Java) and printing the value of lowest and greatest afterward.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!