subject

Write functions to compute a subset, find member, union, and intersection of sets. Follow the steps below: 1. Read two integers from the user.
2. Suppose one of the integers is 2311062158. The binary equivalent of this integer stored in a register will be 1000 1001 1100 0000 0000 0010 1000 1110. This data should be regarded as bit strings representing subsets of the set {1, 2, … 32}. If the bit string has a 1 in position i, then element i is included in the subset. Therefore, the string: 1000 1001 1100 0000 0000 0010 1000 1110 corresponds to the set: {2, 3, 4, 8, 10, 23, 24, 25, 28, 32}.
3. Print out members of the set from smaller to larger. You can do a loop from 1 to 32. Load a masking bit pattern that corresponded to the position number of the loop counter (0x00000001 for 1). Isolate the bit in the operand by using the AND operation. If the result of the AND is not 0 then the loop counter is in the set and should be displayed. Increment the counter and shift the masking bit pattern to the left.
4. Read a number from the user. Determine if that element is a member of the given sets.
5. Determine the union of two sets.
6. Determine the intersection of two sets.
7. Implement a loop back to the main function. See the prompts below: "Enter the first number:" "Enter the second number:" "Members of Set 1:" "Members of Set 2:" "Enter an element to find:" "It is a member/ not a member of set 1" "It is a member/ not a member of set 2" "Union of the sets:" "Intersection of the sets:" "Do you want to compute set functions again?"
8. Test the program using the following data:

Enter the first number: 99999
Enter the second number: 111445
Members of set 1: 1 2 3 4 5 8 10 11 16 17
Members of set 2: 1 3 5 7 9 10 13 14 16 17
Enter an element to find: 7
It is not a member of set 1
It is a member of set 2
Union of the sets: 1 2 3 4 5 7 8 9 10 11 13 14 16 17
Intersection of the sets: 1 3 5 10 16 17

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
Which of the following statements best describes it careers?
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Rachel completed typing an official document with a word processing program. she wants to make sure that her document has no typographical errors. she also wants all headings to have the same font. which features in a word processing program should she use? rachel should use the feature in a word processing program to find typographical errors. she should apply to have uniform headings.
Answers: 1
question
Computers and Technology, 22.06.2019 18:10
Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to the power of the second parameter. write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
You know the right answer?
Write functions to compute a subset, find member, union, and intersection of sets. Follow the steps...
Questions
question
Computers and Technology, 05.10.2019 09:01
question
Chemistry, 05.10.2019 09:01
question
Mathematics, 05.10.2019 09:01
Questions on the website: 13722361