# Simple Calculator

Implement an interpreter for a Simple Mathematical Expression Language (Call it "SMEL," if you like. ;-) ). Permissible Implementation Languages: C, C++ or Java Description of the Language: =========================== Language Support for Operations and Functions: The language supports both unary and binary operations, along with some built-in functions. The unary operations are unary minus and unary plus. The binary operations are +, -, *, /, % (remainder), and ^ (exponentiation). The built-in functions are sin, cos, tan, sqrt, exp, and abs (i.e., sine, cosine, tangent, square root, the constant E raised to some power, and absolute value). Notes: The values passed to the trigonometric functions MUST be in radians. (Converting from degrees to radians is accomplished by multiplying the degree value by PI/180.) In addition, the value passed to the square root function MUST be non-negative. Language Support for Numeric Types: Numeric types supported by the language include integer and floating point numbers. Language Support for Constants: The language also provides some built-in constants, namely PI (3.141593) and E (2.718282), required by the functions sin, cos, tan, and exp. Language Support for Inclusion Symbols: SMEL allows for the use of parentheses, which can be nested arbitrarily deeply. Language Support for Error-Checking: The reporting of errors in the event of: - A malformed mathematical expression (e.g., mismatched parentheses); - An unrecognized function, constant, or operation; - An attempt to divide by zero; - An attempt to take the square root of a negative number; - An attempt to compute the tangent of PI/2 or (3*PI)/2; and ... - An attempt to compute the remainder of two numbers, both of which are not integers; Interactive Features of the Language: Mathematical expressions entered by the user are processed as they are entered. The user types a single-line expression, followed by hitting . If the mathematical expression is valid, its value is printed immediately; otherwise, an error is reported. Sample Interactive Session: ========================== > 4 + 3 * 10 34 > sin(PI/6) 0.5 > 1.5 ^ 3 3.375 > sec(PI/2) Error: unrecognized function > (25 - 5) / (-2 - 2) -5 > exp(0) 1 > sqrt(-6.3) Error: negative argument > quit Good-bye

## Deliverables

Bonus for 24 hour or less turnaround. Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. Confidentiality!

## Platform

Windows 98 or later

Must be completed by 9/2/2002, 8:00am, EST, US. Please keep in mind that I'm a student when viewing my budget amount.

( 8 comentários ) United States

ID do Projeto: #2868219

## Concedido a:

muresanrobert

See private message.

\$20.4 USD em 14 dias
(62 Comentários)
4.2

## 12 freelancers estão ofertando em média \$27 para esse trabalho

aprykhodko

See private message.

\$21.25 USD in 14 dias
(25 Comentários)
5.3
bokbokan

See private message.

\$38.25 USD in 14 dias
(78 Comentários)
5.2
leepwo

See private message.

\$42.5 USD in 14 dias
(41 Comentários)
4.7
sarderhasnut

See private message.

\$8.5 USD in 14 dias
(54 Comentários)
4.8
dafe2002

See private message.

\$10.2 USD in 14 dias
(9 Comentários)
3.4

See private message.

\$42.5 USD in 14 dias
(2 Comentários)
2.9
kitovw

See private message.

\$8.5 USD in 14 dias
(5 Comentários)
1.9
saeedserpooshan2

See private message.

\$17 USD in 14 dias
(3 Comentários)
1.4
pepux

See private message.

\$42.5 USD in 14 dias
(2 Comentários)
0.7
grubenvw

See private message.

\$42.5 USD in 14 dias
(3 Comentários)
0.2
aurigavw

See private message.

\$35.7 USD in 14 dias
(0 Comentários)
0.0