Develop a program to do the folloing operations : 1. Initialize 2 one dimensional arrays ( called A & B ) (10 elements)with random number . The number entered by you. 2. find the sum of the tow arrays in a new array ( called sun ) 3. find the positive of the max element of the new array. 4. Print the thee araays (A , b and sun). Example : Array A : 1 4 3 2 6 7 4 3 1 1 Array B : 1 2 3 4 5 6 7 8 9 1 Result Array Sum : 2 6 6 6 11 13 11 11 10 2 Max found at ( 4 ) My tryng with this program :
import javax.swing.*;
public class Array7{
public static void main(String[] args){
int A[]= {1, 4,3,2,6,7,4,3,1,1};
int B[]= {1,2,3,4,5,6,7,8,9,1};
int sum [] = new int [10];
for (int i = 0;i < 9;i++ ){
}
System.out.println("A Array >>");
for (int i = 0; i < 9;i++ ){
System.out.println(" " + A);
}
System.out.println("B Array >> ");
for (int i = 0;i < B.length;i++ ){
System.out.println(" " + B);
}
for ( int i = 0; i < 9; i++){
sum = (A + B);
}
System.out.println(" "+sum );
}
}