You get wrong answer. You already answer me three times the same wrong answer. 1. Write a program to simplify a Boolean expression. The user will enter from the keyboard a string representing a valid Boolean expression with spaces between the letters. The operators used will be OR (+), AND (*) and NOT (~), and the only valid Input characters will be A, B, +, *, ~, ( , ), 1 and 0. The expression will contain at most 3 operands, 3 operators and one set of parentheses. Output to the screen a line printing the simplified equivalent of the given expression. Simplify means outputting the fewest operators with no parentheses. Use the following list of Boolean Identities to simplify: Refer to the sample output below. Sample Runs (2): Enter a string: ~(A + B) Simplified expression: ~A * ~B Enter a string: ~A * A + 1
You get wrong answer. You already answer me three times the same wrong answer.
1. Write a
representing a valid Boolean expression with spaces between the letters. The operators used will be OR
(+), AND (*) and NOT (~), and the only valid Input characters will be A, B, +, *, ~, ( , ), 1 and 0.
The expression will contain at most 3 operands, 3 operators and one set of parentheses. Output to the
screen a line printing the simplified equivalent of the given expression. Simplify means outputting the
fewest operators with no parentheses. Use the following list of Boolean Identities to simplify:
Refer to the sample output below.
Sample Runs (2):
Enter a string: ~(A + B)
Simplified expression: ~A * ~B
Enter a string: ~A * A + 1
Step by step
Solved in 2 steps