Use Java 1 Write pseudocode that would create an array 16 it
Use Java
1. Write pseudocode that would create an array 16 items long and populate it
with numbers 10 through 25 in order.
2. Write pseudocode for a function that would verify that a 16 item long
array contained the numbers 10 through 25 in order.
Solution
/**
* example program for arrays
*
* @author
*
*/
public class ArrayExample {
/**
* @param args
*/
public static void main(String[] args) {
// 1
// declaring arrays of long type with size 16
long[] data = new long[16];
// initialize arrays from 10 to 16
for (int i = 0; i < 16; i++) {
data[i] = i + 10;
}
// 2
// printing arrays
for (int i = 0; i < 16; i++) {
System.out.print(data[i] + \"\\t\");
}
}
}
OUTPUT:
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
NOTE:
please check i mentioned pseudo as comments
