Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TODO: P05 Task 3 - Write code here to displays all items from the ArrayList of Item objects
- // passed to it.
- itemList = load();
- String output = String.format("%-20s %-10sn", "ITEM", "PRICE");
- for (Item i : itemList) {
- String a = String.format("%s", i.getType().toUpperCase().split(""));
- output += String.format("%-20s %-10.2fn", a.concat(i.getType().substring(1).toLowerCase() ), i.getPrice());
- }
- System.out.println(output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement