Must be done in Netbeans. Must use Java
The program should prompt the user to input a single string that represents a
sequence of transactions. Use semicolon (‘;’) to separate the transactions in the
input string. For example, the program should support the following input string:
“buy 100 share(s) at $20 each; buy 20 share(s) at $24 each; buy 200
share(s) at $36 each; sell 150 share(s) at $30 each; buy 50
share(s) at $25 each; sell 200 share(s) at $35 each;”
The output of the program should be the total capital gain(or loss) for the entire
sequence, using the FIFO protocol as explained. For instance, the output
for the example input should be: $1070.
The program should be able to handle wrong inputs.
Consider using built-in Java classes, e.g., classes that implement the interface