Showing posts with label list of employees using two dimensional array in java. Show all posts
Showing posts with label list of employees using two dimensional array in java. Show all posts

Sunday, October 4, 2015

List of Employee's using Two Dimensional Array in Java

While I'm learning Java programming one of the most important data structure to be studied by every programmings is array. Array refers to a list of values belong with the same data type. There are several kinds of array in Java the first one is one dimensional array, two dimensional and multi dimensional arrays. In this article I would like to show you two dimensional array in Java that will list down the name's of the employee's.  The program code is very short and very easy to understand by beginner's in Java programming. I hope you will find my work useful in your programming projects and assignments.

If you  have some questions please send me an email at jake.r.pomperada@gmail.com and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360.

Sample Program Output


Program  Listing

/*
names_two_dimensional.java
Programmer By: Mr. Jake R. Pomperada, MAED-IT
Date : July 23, 2015
Tools: NetBeans 8.0.2, Java SE 8.0

Problem No. 1:
  
Write a program that show how to assign a variable a value using
two dimensional array and display the result on the screen.
*/


import java.util.Scanner;

class names_two_dimensional {
    
public static void main(String[] args) {
      
     String[][] user_names = 
     {{ "Dr.","Mr.","Engr.","Engr.","Mr."},
     {"Marmelo V. Abante","Jake R. Pomperada,MAED-IT","Ma. Junallie F. Pomperada,Ph.D.",
      "Leslie Vinky P. Pepito, ECE", "Albert A. Pepito,BSIT"}};   
     System.out.println();
     System.out.print("\t LIST OF EMPLOYEES");
     System.out.println("\n\n");
     System.out.println(user_names[0][0] + user_names[1][0]);
     System.out.println(user_names[0][1] + user_names[1][1]);
     System.out.println(user_names[0][2] + user_names[1][2]);
     System.out.println(user_names[0][3] + user_names[1][3]);
     System.out.println(user_names[0][4] + user_names[1][4]);
     System.out.println();
     System.out.print("\t THANK YOU FOR USING THIS PROGRAM");
     System.out.println("\n\n");
  }

} // end of code