Simple Calculator

Completed Posted Aug 31, 2002 Paid on delivery
Completed Paid on delivery

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

## Deadline information

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.

C Programming Engineering Java MySQL PHP Software Architecture Software Testing

Project ID: #2868219

About the project

12 proposals Remote project Active Sep 1, 2002

Awarded to:

muresanrobert

See private message.

$20.4 USD in 14 days
(62 Reviews)
4.2

12 freelancers are bidding on average $27 for this job

aprykhodko

See private message.

$21.25 USD in 14 days
(25 Reviews)
5.3
bokbokan

See private message.

$38.25 USD in 14 days
(78 Reviews)
5.2
leepwo

See private message.

$42.5 USD in 14 days
(41 Reviews)
4.7
sarderhasnut

See private message.

$8.5 USD in 14 days
(54 Reviews)
4.8
dafe2002

See private message.

$10.2 USD in 14 days
(9 Reviews)
3.4
madhusadhanavw

See private message.

$42.5 USD in 14 days
(2 Reviews)
2.9
kitovw

See private message.

$8.5 USD in 14 days
(5 Reviews)
1.9
saeedserpooshan2

See private message.

$17 USD in 14 days
(3 Reviews)
1.4
pepux

See private message.

$42.5 USD in 14 days
(2 Reviews)
0.7
grubenvw

See private message.

$42.5 USD in 14 days
(3 Reviews)
0.2
aurigavw

See private message.

$35.7 USD in 14 days
(0 Reviews)
0.0