Omkar Omkar - 16 days ago 5
Java Question

Menu in systemoutprint is out of place

Okay so I am making a bank machine project and I made the menu with System.out.println. In this bank machine you can deposit withdraw and log off of the machine. However, before the menu it asks you for your last name. The outer parts of the menu has a design like this "|" surrounding the menu so it looks like a rectangle. But once they enter there name depending on the length of there name the "|" will go out of place and will not be aligned with the other ones . This also applies with the balance which. The code does not look readable when I paste it here so here is a screenshot.

enter image description here

Answer

Depending on what length name and bal are, you will see different results.

You should really look into printf if you must create a 'boxed' menu.