You are to build a simple “English language” calculator that does the following:
• Takes three inputs from the keyboard, in the form of
x1 operator x2
where x1 & x2 are single digits (0 to 9) and the operator is a single char, +, -, *, or /.
• Outputs the description of the operation in plain English, as well as the numeric result
Constraints:
• You need to take care not to divide by zero. If the 2nd argument in the division operation is a zero, then you shall display a message “Division by zero is not allowed“
• If the number entered is more than 1 digit then display a message, “Invalid number
• If the operator is not one of the 4 preceding operators then display a message “Invalid operator”
2007-03-20
02:53:51
·
3 answers
·
asked by
LULU
1
in
Computers & Internet
➔ Programming & Design