testLogicals - <<...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// filename: testLogicals.cpp // author: j. dzuback // date: 10/01/09 // modified by: /* ******************************************************** The program is a testbed for evaluating logical expressions for equivalency. Useful to test expressions for De Morgan's Law. ******************************************************** */ #include <iostream> #include <iomanip> # using namespace std; u int main() { int a = 0, b = 0, c = 0, d = 0; bool e = true, f = true;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: &lt;&lt; &quot;separated by a space. Then press enter: &quot;; cin &gt;&gt; a &gt;&gt; b &gt;&gt; c &gt;&gt; d; cout &lt;&lt; endl &lt;&lt; endl; // STUDENT -- fill in to test equivalent expression. Use an assignment operator to // set the true/false values in the bool identifiers e &amp; f. // ie e = !(a == b); // f = (a != b); if (e == f) cout &lt;&lt; &quot;The expressions are equivalent!&quot;; else cout &lt;&lt; &quot;The expressions are not equivalent!&quot;; cout &lt;&lt; endl &lt;&lt; endl; cout &lt;&lt; &quot;***** end of testLogicals.cpp *****&quot;; return 0; } // end of main...
View Full Document

Ask a homework question - tutors are online