public void removeStock(String symbol) throws StockNotExistException,
			IllegalQuantityException {
		boolean stockIsExisist = false;
		int StockSymbolIndex = 0;

		// find the index of symbol
		for (int i = 0; i < portfolioSize; i++) {
			if (symbol.equals(this.stocksStatus[i].getSymbol())) {
				stockIsExisist = true;
				StockSymbolIndex = i;
			}
		}

		// if stock symbol dosen't exists
		if (stockIsExisist == false) {
			throw new StockNotExistException(symbol);
		}
		// if stock index is the last
		if (StockSymbolIndex == MAX_PORTFOLIO_SIZE - 1) {
			sellStock(symbol, stocksStatus[StockSymbolIndex].getStockQuantity());
			portfolioSize--;
		}

		if (stockIsExisist == true) {
			sellStock(symbol, stocksStatus[StockSymbolIndex].getStockQuantity());
			stocksStatus[StockSymbolIndex] = stocksStatus[portfolioSize - 1];
			portfolioSize--;
		}
	}