473,761 Members | 4,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Truth Table

Can some1 help me with the code for a truth table????
Jul 19 '05 #1
2 6596
"Mario" <ma******@ev1.n et> wrote...
Can some1 help me with the code for a truth table????


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.
Jul 19 '05 #2

"Mario Contreras" <ma***@txpos.co m> wrote in message
news:2I******** ************@tw ister.austin.rr .com...
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
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8742
by: PerritoPerron | last post by:
//I need a little help with this program, it runs but the output is not correct. //Can i get some help here please u fellas??? // This Program asks for user input like 1 && 0 and prints if it is true or false // it calculates the input to perform Logical operation from input #include <iostream> using namespace std;
0
1251
by: dayzman | last post by:
Hi, Does anyone know of a C++ package that outputs a (optimised) boolean expression given a truth table? Cheers, Michael
6
2188
by: Tony Johansson | last post by:
Hello Experts! I have the user defined class called Boolean that should be handle all kind of logic expression such as if (a && b && c) or if (!a && b && c) osv I have the class definition Boolean and the main program below. I have overloaded these operator symbols =, ==, !=, !, ||, &&. Now to my question I have some problem with this Class Boolean that I use as
90
3455
by: John Salerno | last post by:
I'm a little confused. Why doesn't s evaluate to True in the first part, but it does in the second? Is the first statement something different? False print 'hi' hi Thanks.
2
1447
by: lemnitzer | last post by:
TV report: all 15 British sailors confess to illegally entering Iranian Waters Here are the links: http://news.google.com/news?hl=en&ned=us&q=all+15&btnG=Search+News http://www.canada.com/ottawacitizen/news/story.html?id=64454ab9-229c-44a8-9875-2f59e570c5f9&k=44029 NOW COMPARE THAT WITH THE YANK MOTHER FUCKING PEDOPHILE BASTARDS AND THE CORRUPT FBI BASTARDS COVERING UP FOR THEIR PEDOPHILE BOSSES:
1
1627
by: Rohanrajs82 | last post by:
Hi, Can anybody help me? I have to construct a truth table of 97 columns. I have tester channels from 1 to 97. I have to make a truth table with all the possible combinations. Also, I have some dummy channels in it where I have to put a dummy value. Regards, Rohan.
6
11450
by: ambanks04 | last post by:
ok taking computer science class anybody know what to do i am not computer literate CoSc 111.003 Spring 2008 Assignment 4 1) Each student shall design, develop, code, test and submit an Original computer program which uses a function or functions to display the TRUTH TABLES for the Logical And, the Logical Or, and the Logical Not operators., as defined in Section 5.8, of the text, 5Th/6Th Edition. 2) The program shall: ...
5
6594
by: andrea | last post by:
Well I would like to make a little program that given a certain logical expression gives the complete truth table. It's not too difficult in fact, I just have some doubts on how to design it. I thought something like that: class Term:
0
9345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.