Connecting Tech Pros Worldwide Help | Site Map

Truth Table

Mario
Guest
 
Posts: n/a
#1: Jul 19 '05
Can some1 help me with the code for a truth table????


Victor Bazarov
Guest
 
Posts: n/a
#2: Jul 19 '05

re: Truth Table


"Mario" <mariocrc@ev1.net> wrote...[color=blue]
> Can some1 help me with the code for a truth table????[/color]

Sure. Where is the code you'd like our help with?...

Start by reading FAQ: http://www.parashift.com/c++-faq-lite/
Pay special attention to section 5, question 5.8.


John Harrison
Guest
 
Posts: n/a
#3: Jul 19 '05

re: Truth Table



"Mario Contreras" <mario@txpos.com> wrote in message
news:2I6Pa.51805$XV.3360528@twister.austin.rr.com. ..[color=blue]
> 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..[/color]

That's not really the biggest problem you will have. Its more or less
irrelevent.
[color=blue]
>
> Any help will be appreciated...
>[/color]

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


Closed Thread