System.out.printf("%-10s \t %8d\n",name[i],stationA[i],getStationScore(stationA[i]),stationB[i],getStationScore(stationB[i]),stationC[i],getStationScore(stationC[i]),award[i]);

hi all, i'm finishing up on this assignment of mine and can't figure out how to format my output correctly.

the correct format should be
Name Station Station
Test A B A b
but so far i only been able to manage to get
Name Station Station
Test A

the rest of the words goes missing. would really appreciate if someone can just point out what's wrong. thanks in advance.

Recommended Answers

All 2 Replies

Well you're only including two place holders "%-10s \t %8d\n" in your format String. Don't you think you should be including more?

omg, haha sorry abt this bad post. just realised my damn mistake. =\ trying to code after a week of partying is a bad idea after all

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.