design a java application that will allow a company to capture staff members contact numbers for adepartment .allow user to enter in a department name and then capture 5 staff members contact number
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter the department name: ");
String departmentName = in.nextLine();
String[] contactNumbers = new String[5];
for (int i = 0; i < contactNumbers.length; i++) {
System.out.print((i + 1) + " contact number: ");
contactNumbers[i] = in.nextLine();
}
}
}
Comments
Leave a comment