brokerage calculator works by taking key inputs from the user, such as the buy price, sell price, quantity of shares or lots, and the type of trading segment