Uploaded by IT learning

1D - java2

advertisement
IT LEARNING
1D Array
Hasan Ali
Hasan Ali
33019949
Use the space below to write a main method that reads five integer values into
an array named list.
Then, use the array to output the average, and the list of odd numbers below
the average.
Hasan Ali
33019949
Write a java program (One class with a main method) to do the following:
Hasan Ali
33019949
Write a Java program (One class with a main method) to do the following:
1. Ask the user to enter an integer (n)
2. Declare an array of size n with integer data type.
3. Ask the user to enter the values of the array.
4. Create another array with of size n with integer data type.
5. Make a copy of the first array to the second array but in reverse order (e.g.,
the last element in the
first array should be store in the first element in the second array and so on).
6. Output values stored in the two arrays.
7. Find and output how many values in both arrays are equal based on the
index number, i.e. count
matching values of two arrays based on same index value AND the element
value of the array.
Hasan Ali
33019949
What is the output of the following code :
Int [] a;
a [4] = {1,2,3,4};
System.out.printn( a[0] );
ABCD-
4
1
2
Compile Error
Hasan Ali
33019949
Download