Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can anyone help me to slove this 4 questions? N Assignment 7-Array String alue o

ID: 3862289 • Letter: C

Question

can anyone help me to slove this 4 questions?





N Assignment 7-Array String alue of a array Write a Java Program to find the Taximim and minimum import java util -Arraya public class ex5MinMax int min Public static va Pabli Did main ting 13, 79 nin array Systen out printin original Array Systen out print in system, out-print i 13, 79 //Maximum //Hininun value for the above array 6. write Java prog e an array of intel ger valbes publie ela publi static void rain 18tring ny arrsyl 2011, 2014 2015, 2016 2012, 2013 Bysten out, printin tostring

Explanation / Answer

5)

Ex5MinMax.java

import java.util.Arrays;

public class Ex5MinMax {
static int max;
static int min;

   public static void main(String[] args) {

       int[] my_array={25,10,55,65,36,92,77,8,13,79};
max_min(my_array);
System.out.println("Original Array:"+Arrays.toString(my_array));
System.out.println("Maximum Value for the above Array:"+max);
System.out.println("Minimum Value for the above Array:"+min);
  
   }

   private static void max_min(int[] my_array) {
       min=my_array[0];
               max=my_array[0];
       for(int i=0;i<my_array.length;i++)
       {
           if(min>my_array[i])
               min=my_array[i];
          
           if(max<my_array[i])
               max=my_array[i];
       }
      
   }

}

______________________

Output:

Original Array:[25, 10, 55, 65, 36, 92, 77, 8, 13, 79]
Maximum Value for the above Array:92
Minimum Value for the above Array:8

_________________

6)

Ex6Reverse.java

import java.util.Arrays;

public class Ex6Reverse {

   public static void main(String[] args) {
       int i, j;
       int[] my_array1 = { 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,2018, 2019 };
       System.out.println("Original Array :" + Arrays.toString(my_array1));

       i = 0;
       j = my_array1.length - 1;

       int temp;
       while (i < j) {
           temp = my_array1[i];
           my_array1[i] = my_array1[j];
           my_array1[j] = temp;
           i++;
           j--;
       }

       System.out.println("Reverse Array :" + Arrays.toString(my_array1));
   }

}

___________________

Output:

Original Array :[2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019]
Reverse Array :[2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010]

_____________________

7) I will do rem also

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote