public static String[] convertUserInput(String input) {
		assertNotNull("User input is null", input);

		int index;
		String temp1, temp2;

		// preprocess of the input string to ease the progress of detecting
		// deadline indicators which are "due at" and "due on"
		if (input.contains(StringFormat.DUE_INDICATOR)) {
			index = input.indexOf(StringFormat.DUE_INDICATOR);
			temp1 = input.substring(index + 4, index + 6);
			temp2 = input.substring(index + 6);
			input = input.substring(0, index + 3);
			if (temp1.equals(StringFormat.ON_INDICATOR)) {
				input = input.concat(StringFormat.ON_INDICATOR);
			} else {
				input = input.concat(StringFormat.AT_INDICATOR);
			}
			input = input.concat(temp2);
		}

		String[] arg = input.trim().split(StringFormat.SPACE_INDICATOR);
		String[] parsedInput;
		String userAction = arg[0].toLowerCase(); // arg[0] stores the action of
													// the user

		switch (userAction) {
		case StringFormat.ADD:
			parsedInput = handleAddInput(arg);
			break;
		case StringFormat.DELETE:
			parsedInput = handleDeleteInput(arg);
			break;
		case StringFormat.UPDATE:
			parsedInput = handleUpdateInput(arg);
			break;
		case StringFormat.SORT:
			parsedInput = handleSortInput(arg);
			break;
		case StringFormat.SEARCH:
			parsedInput = handleSearchInput(arg);
			break;
		case StringFormat.DONE:
			parsedInput = handleDoneInput(arg);
			break;
		case StringFormat.DISPLAY:
			parsedInput = handleDisplayInput(arg);
			break;
		default:
			parsedInput = new String[1];
			parsedInput[0] = arg[0];
		}

		return parsedInput;
	}