Hi guys I have a bit of a problem here about the alignment
no what I try it always end up like that, the 2nd-3rd row course and sexcode column is what I want to fix >.<
package studlist;
here's my code:
public class StudList {
public static void main(String[] args) {
//Variable Declaration
int totalRec = 0, totalF = 0, totalM = 0, ctr;
String[] studNo = {"397-1010", "380-1120", "390-1350", "345-1235"};
String[] studNa = {"R.Santos", "A.Cruz", "J.Lim", "S.Corona"};
String[] course = {"BSIT", "BSCS", "BSIT", "ACT"};
char[] sexCode = {'M', 'M', 'F', 'F'};
//Print Titles & Subtitles
System.out.println(" List of Students");
System.out.println();
System.out.print("Student No.\tName\t\tCourse\t\tSex \n");
//Print Student Records
for (ctr = 0; ctr < studNo.length; ctr++)
{
System.out.print(studNo[ctr] + "\t");
System.out.print(studNa[ctr] + "\t");
System.out.print(course[ctr] + "\t\t");
System.out.print(sexCode[ctr] + "\n");
}
}
}