473,385 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Truth Table

Can some1 help me with the code for a truth table????
Jul 19 '05 #1
2 6580
"Mario" <ma******@ev1.net> 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.com> wrote in message
news:2I********************@twister.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
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...
0
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
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...
90
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
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...
1
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...
6
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...
5
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. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.