Reference no: EM13707333
You need to prepare a Lisp program to evaluate the arithmetic expressions.
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 case, the subsequent 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 given 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 given in the above case. If the input is illegal, the result is undefined, i.e., your program assumes the input is legal.
Compute the mixture-averaged mass specific gibbs free energy
: Using the thermodata computed from the matlab functions to compute the mixture-averaged mass specific Gibbs free energy of the final mixture, as a function of the progress variable (normalized as: 0 for no dissociation, and 1 for complete dissociatio..
|
What is the pressure change in the gas
: A closed volume of 1 m3 of air (at sea level) is heated from 20°C to 400°C. Use the values for specific heat (cv =20.786 J/molK , cp= 29.1006 J/molK) and the specific gas constant R=8.31446 J/molK
|
Determine heat transferred to and word produced by steam
: Steam at 75kPa and 13 percent quality is contained in a spring loaded piston-cylinder device with an initial volume of 3.90m^3. Steam is now heated until its volume is 9.75m^3 and its pressure is 300kPa. Determine the heat transferred to and the word..
|
Determine the mass flow rate of steam through the boiler
: A steam power plant operates on an ideal reheat-regenerative Rankine cycle with one reheater and two open feed water heaters. Steam enters the high-pressure turbine at 1,500 psia and 1,100 degrees Farenheit and leaves the low-pressure turbine at 1 ps..
|
Evaluate the arithmetic expressions
: Prepare a Lisp program to evaluate the arithmetic expressions - If the input is legal, your program should output the final result of the expression evaluation, as given in the above case. If the input is illegal, the result is undefined, i.e., you..
|
How you want to configure the clock input to the timer block
: Clearly describe how you want to configure the clock input to the Timer block and what period value you will choose for the Timer block.
|
Evaluates and prints the value of the polynomial
: Write a program that evaluates and prints the value of the polynomial ax2 + bx + c, given user inputs for a, b, c, and x using integers and floats.
|
Write an isr and startup code for a system
: Write an ISR and startup code for a system that lights up LED0 on a PSoC Eval1 board (suppose that a wire is connecting P1[0]) to show "Low Voltage" whenever there is a supply voltage monitor interrupt.
|
What is the turnaround time for each process
: Show the scheduling order of the processes using a Gantt chart and what is the turnaround time for each process?
|