Question

In: Computer Science

C++ This assignment will have you designing a program which can test multiple combinations of the...

C++

This assignment will have you designing a program which can test multiple combinations of the Boolean variables A, B, and C, and determine which combinations of them will yield true values. However the statement is designed in the style of a Logical Circuit.You are asked to create three truth tables for the three problems.First, convert the diagram to boolean algebra equations.Then evaluate their values step by step based on the values of A, B and C.

Finally, print the truth table on the screen with detailed computational steps and boolean algebra symbols. Your headers will be the boolean algebra expressions.You are asked to submit source file and screen prints only.

Solutions

Expert Solution

CODE:

#include<iostream>

using namespace std;

int main()
{
// define the variables A,B and C
   int A,B,C;
   // print the header section with A,B,C and then the result of boolean combination
   cout<<"A\tB\tC\tAB+C\tA+BC\tB+AC";
  
   //run a loop for A , B and C for all possible curcuit combinations of 0 & 1
   for(A=0;A<=1;++A)
       for(B=0;B<=1;++B)
           for(C=0;C<=1;++C)
           {
           // bounday condition where the sum is leading to 2 rather than usual 1
               if(A*B+C==2||A+B*C==2||B+A*C==2)
                   cout<<"\n\n"<<A<<"\t"<<B<<"\t"<<C<<"\t1"<<"\t1"<<"\t1";
               else
                   cout<<"\n\n"<<A<<"\t"<<B<<"\t"<<C<<"\t"<<A*B+C<<"\t"<<A+B*C<<"\t"<<B+A*C;
           }
  
   return 0;
}

RESULT:


Related Solutions

C++ This assignment will have you designing a program which can test multiple combinations of the...
C++ This assignment will have you designing a program which can test multiple combinations of the Boolean variables A, B, and C, and determine which combinations of them will yield true values. However this time the statement is designed in the style of a Logical Circuit. You are asked to create three truth tables for the three problems. To achieve this, you should create SEVEN gate functions for your checkpoint. For each of the problem: First, convert the diagram to...
Code in C++ please You are going to write a program for Computer test which will...
Code in C++ please You are going to write a program for Computer test which will read 10 multiple choice questions from a file, order them randomly and provide the test to the user. When the user done the program must give the user his final score
Consider the program which you can find on Moodle that draws random lines. In this assignment,...
Consider the program which you can find on Moodle that draws random lines. In this assignment, you will extend that program to draw triangles and quadrilaterals. Create classes Traingle and Quadrilaterals. Declare a constructor in each class as follows: public Triangle (int x1, int y1, int x2, int y2, int x3, int y3, Color color) public Quadrilateral (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, Color color) Each class of these two...
I need specific codes for this C program assignment. Thank you! C program question: Write a...
I need specific codes for this C program assignment. Thank you! C program question: Write a small C program connect.c that: 1. Initializes an array id of N elements with the value of the index of the array. 2. Reads from the keyboard or the command line a set of two integer numbers (p and q) until it encounters EOF or CTL - D 3. Given the two numbers, your program should connect them by going through the array and...
C PROGRAMMING – Steganography In this assignment, you will write an C program that includes processing...
C PROGRAMMING – Steganography In this assignment, you will write an C program that includes processing input, using control structures, and bitwise operations. The input for your program will be a text file containing a large amount of English. Your program must extract the “secret message” from the input file. The message is hidden inside the file using the following scheme. The message is hidden in binary notation, as a sequence of 0’s and 1’s. Each block of 8-bits is...
Program Assignment 1 C++ please Instructions This assignment will require the use of three arrays, which...
Program Assignment 1 C++ please Instructions This assignment will require the use of three arrays, which will be used in parallel. Create a program that keeps track of the sales of BBQ sauces for a company. The company makes several different types of sauces, Original, Sticky Sweet, Spicy, Sweet Heat, Hickory Bourbon and Smokey Mesquite. One array will contain the names of the different BBQ sauces. This array will be initialized from a text file with the 6 different names....
In C++ For this assignment, you will write a program to count the number of times...
In C++ For this assignment, you will write a program to count the number of times the words in an input text file occur. The WordCount Structure Define a C++ struct called WordCount that contains the following data members: An array of 31 characters named word An integer named count Functions Write the following functions: int main(int argc, char* argv[]) This function should declare an array of 200 WordCount objects and an integer numWords to track the number of array...
For this computer assignment, you are to write a C++ program to implement a class for...
For this computer assignment, you are to write a C++ program to implement a class for binary trees. To deal with variety of data types, implement this class as a template. Most of the public member functions of the BinaryTree class call private member functions of the class (with the same name). These private member functions can be implemented as either recursive or non-recursive, but clearly, recursive versions of these functions are preferable because of their short and simple implementations...
: In this assignment you will write a C++ program that evaluates an arithmetic expression (represented...
: In this assignment you will write a C++ program that evaluates an arithmetic expression (represented with an infix notation), then outputs this expression in prefix form and also outputs the result of the calculation. The program will first convert the input infix expression to a prefix expression (using the Stack ADT) and then calculate the result (again, using the Stack ADT). The details are provided in the following sections.
One student going into the test which is set in multiple choice (A, B, C, D)....
One student going into the test which is set in multiple choice (A, B, C, D). The test consist of 5 question. But he is not study at all. He decide to get ‘’A” for each of the question. There will be no penalty for incorrect answer. What is the probability he will passes the test (He get at least 3 question correctly)?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT