I need help into formating the output of an Java application on which I work.
The output should look like this(evrey line bellow coresponding category):
---------------------------------------------------
|Account number| Savings Balance| Checking Balance|
---------------------------------------------------
|an integer | a double | a double|
---------------------------------------------------
|............ | ......... | ...........|
---------------------------------------------------
What I have done:
System.out.println("|--------------| ---------------| ----------------|");
System.out.println("|Account number| Savings balance| Checking balance|");
for (int i=0; i<a.length; i++)
{
System.out.println("|"+a[i].getAccountNo()+"|"+a[i].getSavingBal()+"|"+a[i].getCheckingBal()+"|");
System.out.println("|--------------| ---------------| ----------------|");
}
System.out.println("|--------------| ---------------| ----------------|");