Truth Table

J

John Harrison

Mario Contreras said:
I need to ask the user to enter input like

true && false || ( true && true)

and display the output either true or false..,
any ideas???

can I use cin to put values in variables or cin.getline..

That's not really the biggest problem you will have. Its more or less
irrelevent.
Any help will be appreciated...

You need to write a parser. How to do this is far too complicated to explain
in a newsgroup posting. Suggest you buy a book which explains parsing
techniques. For instance 'The C++ Programming Language' by Stroustrup has an
arithmentic expression parser as an example. You want a boolean expression
parser (or truth table as you put it) but the principles are the same, you
should be able to adapt the code.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top