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 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 boolean algebra equations.Then evaluate their values gate by gate based on the values of A, B and C. Finally, print the truth table on the screen with detailed computational gates and boolean algebra symbols. Your headers will be the boolean algebra expressions.

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 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...
Please complete in only C++, using loops Assignment: For this assignment you’ll be designing a program...
Please complete in only C++, using loops Assignment: For this assignment you’ll be designing a program which can take the input of a decimal number and a numerical base, and convert the decimal number to that base. For example, if given the decimal number seven and the base two, your program should output it as 111, which is how seven is represented in binary. Another example, 8,943 in base 10, is 13,236 in base 9. You’ll need to perform these...
REVERSE POLISH CALCULATOR C++ ONLY. For this assignment, you are to write a program, which will...
REVERSE POLISH CALCULATOR C++ ONLY. For this assignment, you are to write a program, which will calculate the results of Reverse Polish expressions that are provided by the user. You must use a linked list to maintain the stack for this program (NO array implementations of the stack). You must handle the following situations (errors): Too many operators (+ - / *) Too many operands (doubles) Division by zero The program will take in a Polish expression that separates the...
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...
Write and test a C program to implement Bubble Sort. . In your C program, you...
Write and test a C program to implement Bubble Sort. . In your C program, you should do: Implement the array use an integer pointer, get the size of the array from standard input and use the malloc function to allocate the required memory for it. Read the array elements from standard input. Print out the sorted array, and don’t forget to free the memory. Debug your program using Eclipse C/C++ CDT.
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....
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...
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...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT