I need help the problem below (system give me answer is wrong). 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)
I need help the problem below (system give me answer is wrong).
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
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images