Question: C++ Program. No Global Variables . PLEASE use functions OR, AND and XOR Calculate the boolean algebraic results for OR, AND and XOR of the

C++ Program. No Global Variables. PLEASE use functions

OR, AND and XOR Calculate the boolean algebraic results for OR, AND and XOR of the two input arrays

Performed on an element by element basis. An element of the first array is combined (using OR, AND or XOR boolean algebra) with the same element of the second array

OR if at least one of the two elements has a value of 1, the OR result is 1 otherwise it is a 0 (both elements are 0)

AND if the elements of both arrays have a value of 1, the AND result is 1 otherwise it is a 0

XOR if the value of one element is a 1 and the value of the other element is a 0, the XOR result is 1 otherwise it is a 0 Then convert from binary to decimal

Output of input array values Print a heading similar to the one in the sample solution Print out headings for the array left justified in a field width of 2*numCols Print the two arrays side-by-side separated by 4 spaces - Array elements are printed with a single space between them.

- Output OR AND XOR values

-Output Integer Equivalents

Input Files: 1. 10 // number of rows 10 // number of columns

0 0 1 1 0 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0

1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1

Input File2:

5 // number of rows

5 // number of columns

0 0 1 1 0

1 1 0 0 1

0 1 1 0 0

1 0 0 1 1

1 1 0 0 0

1 1 1 1 1

0 0 0 0 0

1 1 1 1 1

0 0 0 0 0

1 1 1 1 1

OutPut Should look similar to this(Done with input file 1)

C++ Program. No Global Variables. PLEASE use functions OR, AND and XOR

Here is with input file 3:

Calculate the boolean algebraic results for OR, AND and XOR of the

Enter the name of the input file: P9_inl.txt P9 inl.txt Initial values of the arrays processed Array 1 Array 2 OR, AND and XOR results OR AND XOR Integer Equivalents for the rows of the OR, AND and XOR arrays OR AND 198 396 792 XOR 1023 825 1023 627 1023 1023 825 1023 627 1023 825 825 627 627 231 825 825 627 627 231 198 396 792

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!