------------------------------- Welcome to my CalThon Language! ------------------------------- CalThon allows you to perform basic arithmetic. The language generates a smart message if its syntax is not followed. - add by using a statement: ADD N1 AND N2 - subtract by using a statement: SUB N2 FROM N1 - multiply by using a statement: MUL N1 BY N2 - divide by using a statement: DIV N1 BY N2 Note: - N1 and N2 are operands - any numbers you wish. - ADD, SUB, MUL and DIV are four operators. - AND, FROM and BY are three keywords. - Operators and keywords can be lowercase or mixed case. - N2 should not be zero if the operation is DIV! The equation you enter must follow this syntax: A is a white space character. ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: banana You entered: 'banana'. Error 00: Invalid statement, since you entered a sequence of letters 'banana'. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: You entered: ''. Error 01: Have you simply pressed the Enter key? Try again!) ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: ADD You entered: 'ADD '. Error 02: Invalid statement, since it contains an operator ADD only. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: FROM You entered: 'FROM '. Error 03: Invalid statement, since it only contains the keyword FROM. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: 56 You entered: '56 '. Error 04: Invalid statement, since it only contains the operand 56. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: HJJ You entered: 'HJJ '. Error 05: Invalid statement, since it only contains invalid characters HJJ. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: ADD SUB You entered: 'ADD SUB '. Error 06: Invalid statement, since it only contains the operators ADD and SUB. Missing operands and a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: AND FROM You entered: 'AND FROM '. Error 07: Invalid statement, since it only contains the keywords AND and FROM. Missing an operator and operands. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: ADD BY You entered: 'ADD BY'. Error 08: Invalid statement, since it only contains ADD and BY operator/keyword. Missing operands. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: MUL 78 You entered: 'MUL 78'. Error 09: Invalid statement, since it only contains MUL and 78 operator/operand. Missing a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: BY 45 You entered: 'BY 45'. Error 10: Invalid statement, since it only contains BY and 45 keyword/operand. Missing an operator. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: DIV HJN97 You entered: 'DIV HJN97'. Error 11: Invalid statement, since it only contains operator DIV and other charcters HJN97. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: from rt56 You entered: 'from rt56'. Error 12: Invalid statement, since it only contains kwyword FROM and other charcters rt56. Missing an operator and operands. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: 67 56 You entered: '67 56'. Error 13: Invalid statement, since it only contains 67 and 56 operands. Missing an operator and a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: 56 GHJ You entered: '56 GHJ'. Error 14: Invalid statement, since it only contains 56 and GHJ operand/other characters. Missing an operator, an operand and a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: abc xy3 You entered: 'abc xy3'. Error 15: Invalid statement, since it only contains invalid charcters abc and xy3. Missing an operator, operands, and a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: ADD SUB MUL You entered: 'ADD SUB MUL'. Error 16: Invalid statement, since it only contains the operators ADD, SUB and MUL. Missing operands and a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: AND BY FROM You entered: 'AND BY FROM'. Error 17: Invalid statement, since it only contains the keywords AND, BY and FROM. Missing an operator and operands. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: 78 56 54 You entered: '78 56 54'. Error 18: Invalid statement, since it only contains 78, 56 and 54 operands. Missing an operator and a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: SUB 10 45 You entered: 'SUB 10 45'. Error 19: Invalid statement, since it only contains an operator SUB, and two operands 10 and 45. Missing a keyword. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: 10 AND 20 You entered: '10 AND 20'. Error 20: Invalid statement, since it only contains a keyword AND, and two operands 10 and 20. Missing an operator. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: add abc def You entered: 'add abc def'. Error 21: Invalid statement, since it does not contain a valid keyword and two operands. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: a b 5 You entered: 'a b 5'. Error 22: Invalid statement, since it does not contain a valid operator, a keyword and/or operand(s). Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: a by 7 You entered: 'a by 7'. Error 23: Invalid statement, since it does not contain a valid operator and/or operand(s). Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: DIV x 9 You entered: 'DIV x 9'. Error 24: Invalid statement, since it does not contain a valid keyword and/or operand(s). Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: MUL 15 FROM 10 Syntax Error 25. Wrong keyword is used in MUL 15 FROM 10. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: ADD 10 20 AND Syntax Error 26. The arithmetic statement ADD 10 20 AND is in error. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: ADD 5 6 AND 7 Syntax Error 26. The arithmetic statement ADD 5 6 AND 7 is in error. Try again! ________ Enter an arithmetic statement or 'Q' or 'q' to Quit the Calculator: DIV 10 BY 2 AND 5 Syntax Error 26. The arithmetic statement DIV 10 BY 2 AND 5 is in error. Try again! ________