Class StonkAppMain

Object
StonkAppMain

public class StonkAppMain extends Object
  • Field Details

  • Constructor Details

    • StonkAppMain

      public StonkAppMain()
  • Method Details

    • go

      public void go()
      Main controller for program.
    • walletInitializer

      public void walletInitializer()
      Initializes the wallet, either default or with custom values based on user input.
    • parseAction

      public void parseAction(String action)
      Parses through user input and performs correlated action.
      Parameters:
      action - Desired action to be performed by user
    • purchaseFazCoin

      public void purchaseFazCoin(int numFazCoin)
      Adds FazCoin to the wallet and removes appropriate USD amount

      When buying FazCoin:

      • Check if there is enough money in your wallet to buy the desired number of FazCoin.
      • If you can, then add the purchased FazCoin to your wallet and subtract the cost of the purchased FazCoin from your total USD.
      • Otherwise, if the desired amount of FazCoin costs more than you currently have in USD, print a statement such as "You do not have enough money to buy that much FazCoin."
      Parameters:
      numFazCoin - Number of FazCoin you are trying to buy
    • sellFazCoin

      public void sellFazCoin(int numFazCoin)
      Removes FazCoin from the wallet and adds appropriate USD amount

      When selling FazCoin:

      • Check if there is enough FazCoin in your wallet to sell the desired number of FazCoin.
      • If you can, then subtract the sold FazCoin from your wallet and add the price of the sold FazCoin to your total USD.
      • Otherwise, if the desired amount of FazCoin to sell exceeds your current amount of FazCoin, print a statement such as "You do not have enough FazCoin to sell."
      Parameters:
      numFazCoin - Number of FazCoin that you are trying to sell
    • main

      public static void main(String[] args)