repl.it
@Hariz_Hazril/

🏫School Project - Array

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 public class Main { 
	 public static void main (String[] args) { 
		 String [] senaraiNama = new String[5];

		  senaraiNama [0] = "Adam";
		  senaraiNama [1] = "Alia";
			senaraiNama [2] = "Wong";
			senaraiNama [3] = "Devi";
			senaraiNama [4] = "Developer";

			int [] senaraiUmur = {16,17,16,17,0};

      double [] senaraiTinggi = {182.1,172.5,173.2,175.0,0};
			
			System.out.println ("NAMA\tUmur\tTinggi(cm)");

			for (int i=0;i<5;i++) { 
				System.out.print (senaraiNama [i] + "\t"); System.out.print (senaraiUmur [i] + "\t\t"); System.out.print (senaraiTinggi [i] + "\t");
		    System.out.println ();
			}
	 }
 }