Java Homework - Stack Class
$10-30 USD
Pagado a la entrega
Using the [url removed, login to view] as a base, make a postfix boolean expression
evaluator program. This is very similar to the postfix integer
expression evaluator except the operands can only be true and false
and the operators are !, && and ||, (i.e. the three logical operators).
Example postfix boolean expressions:
true false &&
postfix for: true && false = false
true false ! &&
postfix for: true && !false = true
true true ! false || ! && true false && ||
postfix for: true && !(!true || false) || (true && false) = true
true !
postfix for: !true = false
true true false ! && || false || false false && true ! && || true ||
postfix for: true || true && !false || false || false && false && !true || true = true
true ! false && true false && || true ||
postfix for: !true && false || true && false || true = true
true false && ! true false true || && ||
postfix for: !(true && false) || true && (false || true) = true
true false && true false && || true || !
postfix for: !(true && false || true && false || true) = false
The program is analogous to the Postfix.java. The stack will contain Boolean objects.
You can use the code of Postfix, changing each Integer to Boolean
and each int to boolean (notice the capital letters).
! is a unary operator, so only the most recently pushed operand is
popped off the stack and has the ! operator applied to it.
Nº del proyecto: #5799608
Sobre el proyecto
Adjudicado a:
It looks like as pretty easy assignment, it's possible to complete it in few hours..........................