Reference no: EM13168498
Write a Lisp program to evaluate Lisp arithmetic expressions. Assume four operators may be used in expressions and they are +, -, *, and /. All these operators are binary, i.e., they are applied in an expression in this format: (operator operand1 operand2), where "operator" can be +, -, *, or /, and each operand can be either a single number, or another expression. For example, the following are all legal input:
(+ 1 2)
(- 6 (/ 7 0.5))
(* (/ 78 (- 67 3.5)) (+ 4 9.0))
But the following are not:
(+ 1) ; missing operand
(6 - 7) ; every expression must start with an operator
(/ + 4 5) ; every expression can only have one operator
(* 6 7 8) ; every expression must have exactly two operands
(% 6 7 ) ; unrecognizable operator
(- 6 A) ; illegal operator
Name the main function of your program "main". The following should be the way to run your program:
? (main '(+ 1 2))
3
where '(+ 1 2) is the input. If the input is legal, your program should output the final result of the expression evaluation, as shown in the above example. If the input is illegal, the result is undefined, i.e., your program assumes the input is legal.
Need program file.
Which allows to input a year and when hit the check button
: Create a JAVA GUI (With Frame), which allows to input a year and when hit the check button, will show the picture of Chinese zodiac animal! I am trying to make a calculator: i have the method for or the calculation method to show how to calculate:
|
Determine the formula for x
: When the compound spontaneously decomposes, the piston moves up, the temperature of the water reaches a maximum of 29.52°C, and then it gradually decreases as the water loses heat to the surrounding air.
|
How many cro42- ions are present
: A sample of silver chromate (Ag2CrO4) has a mass of 24.7 g. (a) How many Ag+ ions are present? ions (b) How many CrO42- ions are present? ions (c) What is the mass in grams of one formula unit of silver chromate? g/formula unit
|
The array is sorted except the first one
: the array is sorted except the first one
|
Write a lisp program to evaluate lisp arithmetic
: Write a Lisp program to evaluate Lisp arithmetic expressions. Assume four operators may be used in expressions and they are +, -, *, and /. All these operators are binary, i.e., they are applied in an expression in this format
|
Java is considered to be safe from buffer overflows
: Java is considered to be safe from buffer overflows. Does that make it more appropriate to use as a s development language when security is concerned? Be sure and weight all if the risks involved in product development, not just the security aspec..
|
Describe an algorithm that takes as input a list of n
: Describe an algorithm that takes as input a list of n distinct integers and finds the location of the largest even integer in the list or returns 0 if there are no even integers in the list.
|
That reads ten numbers from input and prints
: Write a C program that reads ten numbers from input and prints them in reverse order. We assume that the data consists of integers. The program should conform to the following format
|
Write a join query that for every order placed on september
: Write a join query that for every order placed on September 5, 1998, (use '05-SEP-1998') will list the order number and order date along with the customer number, last name, and first name of the customer who placed the order
|