assignment12

# assignment12 -...

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

/* Write a program to create the following truth table. DO NOT HARD-CODE THE ANSWERS IN THE OUTPUT! This means that each of the cout statements must use variables for the "1" and "0" values. In this exercise, you need to make the output match exactly, including the spacing on each line. x | y | (x && y) | !(x && y) =============================== 1 | 1 | 1 | 0 1 | 0 | 0 | 1 0 | 1 | 0 | 1 0 | 0 | 0 | 1 */ 0 #include<iostream> using namespace std; int main () { bool x,y; b cout << " x\t|\ty\t|\t(x && y)\t|\t!(x && y)" << endl;
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout << "=======================================================================" << endl; x = true, y = true ; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; x = true, y = false ; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; x= false, y = true; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; x = false, y = false; cout << x << "\t|\t" << y << "\t|\t" << (x&&y) << "\t\t|\t" << !(x&&y)<< endl; c }...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern