Question: Language: C++ use these: these should be output: Lab 02: Truth Table CSC1501 **Submission deadline: Monday, February 3 at 16:00 1. Truth Table of Logical
Language: C++

use these:



these should be output:

Lab 02: Truth Table CSC1501 **Submission deadline: Monday, February 3 at 16:00 1. Truth Table of Logical Operators (40 points) Write a program that produces the truth table of the following logical operators. You are supposed to output one table with all the operators (one column for each operator). Write the header of the table - this is the name of the columns-. Output the result on the file progl outpu t.txt. The table should contain the letters T and F, it should NOT print 1s and Os. Show the results on the following order: 1. negation (!) 2. disjunction (AND operator, &) 3. conjunction (OR operator, 1). A CHECK POINT HERE ^ 4. exclusive or (or but not both, ^). 5. implication (CONDITIONAL operator, ->) 6. biconditional () 2. Truth Table of Compound Propositions (60 points) Write a program that produces truth tables for the following compound propositions. Write the header of the tables, including intermedial steps and the final result. There should be three tables. Output the result on the file prog2 output.txt. 1. p&!(pla) 2. (p19)&! (p&q) 3. (p->q)(!q->!p) NOTE: Do not hard code truth tables. The program must use binary or bitwase operators to compute the results. char b2c(bool b){ if (b == true) return 'T'; else return 'F'; p = true; q = true; cout q|pq| L |TT|FF|TT | FT T | TTFF TFT T F F | FTT|F|FT T T F | |FF|TT|FF|FT T | ========================================= Lab 02: Truth Table CSC1501 **Submission deadline: Monday, February 3 at 16:00 1. Truth Table of Logical Operators (40 points) Write a program that produces the truth table of the following logical operators. You are supposed to output one table with all the operators (one column for each operator). Write the header of the table - this is the name of the columns-. Output the result on the file progl outpu t.txt. The table should contain the letters T and F, it should NOT print 1s and Os. Show the results on the following order: 1. negation (!) 2. disjunction (AND operator, &) 3. conjunction (OR operator, 1). A CHECK POINT HERE ^ 4. exclusive or (or but not both, ^). 5. implication (CONDITIONAL operator, ->) 6. biconditional () 2. Truth Table of Compound Propositions (60 points) Write a program that produces truth tables for the following compound propositions. Write the header of the tables, including intermedial steps and the final result. There should be three tables. Output the result on the file prog2 output.txt. 1. p&!(pla) 2. (p19)&! (p&q) 3. (p->q)(!q->!p) NOTE: Do not hard code truth tables. The program must use binary or bitwase operators to compute the results. char b2c(bool b){ if (b == true) return 'T'; else return 'F'; p = true; q = true; cout q|pq| L |TT|FF|TT | FT T | TTFF TFT T F F | FTT|F|FT T T F | |FF|TT|FF|FT T | =========================================
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
