Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Find Maximum and Minimum in Array Challenge | Methods
Java Extended
course content

Contenido del Curso

Java Extended

Java Extended

1. Deep Java Structure
2. Methods
3. String Advanced
4. Classes
5. Classes Advanced

bookFind Maximum and Minimum in Array Challenge

Tarea

Your task is to write two methods: one to find the maximum value and one to find the minimum value in the array.

  1. In the findMax method, initialize the max variable with the first element of the array.
  2. In the for loop, compare the current element with max.
  3. If the current element is greater, update max with the current element.
  4. Return the value of the max variable.
  5. In the findMin method, initialize the min variable with the first element of the array.
  6. In the for loop, compare the current element with min.
  7. If the current element is smaller, update min with the current element.
  8. Return the value of the min variable.
  9. In the main method, call the findMax method with the correct parameter, pass the numbers array into it, and assign the result to the max variable.
  10. In the main method, call the findMin method with the correct parameter, pass the numbers array into it, and assign the result to the min variable.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 8
toggle bottom row

bookFind Maximum and Minimum in Array Challenge

Tarea

Your task is to write two methods: one to find the maximum value and one to find the minimum value in the array.

  1. In the findMax method, initialize the max variable with the first element of the array.
  2. In the for loop, compare the current element with max.
  3. If the current element is greater, update max with the current element.
  4. Return the value of the max variable.
  5. In the findMin method, initialize the min variable with the first element of the array.
  6. In the for loop, compare the current element with min.
  7. If the current element is smaller, update min with the current element.
  8. Return the value of the min variable.
  9. In the main method, call the findMax method with the correct parameter, pass the numbers array into it, and assign the result to the max variable.
  10. In the main method, call the findMin method with the correct parameter, pass the numbers array into it, and assign the result to the min variable.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 8
toggle bottom row

bookFind Maximum and Minimum in Array Challenge

Tarea

Your task is to write two methods: one to find the maximum value and one to find the minimum value in the array.

  1. In the findMax method, initialize the max variable with the first element of the array.
  2. In the for loop, compare the current element with max.
  3. If the current element is greater, update max with the current element.
  4. Return the value of the max variable.
  5. In the findMin method, initialize the min variable with the first element of the array.
  6. In the for loop, compare the current element with min.
  7. If the current element is smaller, update min with the current element.
  8. Return the value of the min variable.
  9. In the main method, call the findMax method with the correct parameter, pass the numbers array into it, and assign the result to the max variable.
  10. In the main method, call the findMin method with the correct parameter, pass the numbers array into it, and assign the result to the min variable.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Tarea

Your task is to write two methods: one to find the maximum value and one to find the minimum value in the array.

  1. In the findMax method, initialize the max variable with the first element of the array.
  2. In the for loop, compare the current element with max.
  3. If the current element is greater, update max with the current element.
  4. Return the value of the max variable.
  5. In the findMin method, initialize the min variable with the first element of the array.
  6. In the for loop, compare the current element with min.
  7. If the current element is smaller, update min with the current element.
  8. Return the value of the min variable.
  9. In the main method, call the findMax method with the correct parameter, pass the numbers array into it, and assign the result to the max variable.
  10. In the main method, call the findMin method with the correct parameter, pass the numbers array into it, and assign the result to the min variable.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 2. Capítulo 8
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
some-alt