i wrote an example for you. the code is not perfect, but runs without errors as long the input is correct. i hope, you got the idea, so you can enhance your own code.


import java.io.*;

public...