Answer:
Following are the program in Java language
import java.util.Scanner; // import package
class Main // main class
{
public static void main (String [] args) // main method
{
int k=0; // variable declaration
// declaration of variable
final int size = 4; // declared the constant variable
int[] keysList = new int[size]; // declared the array of keysList
int[] itemsList = new int[size]; // // declared the array of itemsList
keysList[0] = 32; // storing the value in KeysList
keysList[1] = 105; // storing the value in KeysList
keysList[2] =101; // storing the value in KeysList
keysList[3] = 35;
// storing the value in KeysList
itemsList[0] = 10;
// storing the value in itemList
itemsList[1] = 20;
// storing the value in itemLis
itemsList[2] = 30;
// storing the value in itemLis
itemsList[3] = 40;
// storing the value in itemLis
while(k<itemsList.length) // iterating the loop
{
if(keysList[k]>60) // check the condition
{
System.out.print(itemsList[k]); // display the value
System.out.print(";"); //print space
}
k++; // increment of k by 1
}
}
Output:
20;30;
Explanation:
Following are the description of Program
- Create a variable "k" and Initialized with "0".
- Declared a constant variable "size" with the value 4.
- Declared the array "keysList" and " itemsList" also their value will be initialized.
- After that iterating the while loop and check the condition of keysList array with a value greater than 60 then display the corresponding value in itemsList.