Using a C language, write a C program that will display the menu as shown below and will ask the user to pick a choice that will perfom its function. For example, the user choice 1] which is to get the CARDINAL NUMBER OF A SET, the program must ask the user to input any set of numbers before getting its cardinality. Same goes to the other choices. Make the descriptions below as the reference for each choices in the MENU. It is an algebra and I don't have any idea how to code the above mention. M E N U 1] CARDINAL NUMBER OF A SET 2] UNION OF SETS 3] INTERSECTION OF SETS 4] DIFFERENCE OF 2 SETS 5] COMPLEMENT OF A SET 6] QUIT Enter choice: Description in every choices: 1] Cardinal Number of a Set Example: Set A ={1, 4, 0, -3, -1, 3, 17} Cardinal Number of Set A = 7 2] Union of Sets Example: Set A ={1, 4, 0, -3, -1, 3, 17} Set B = {2, 4, 6, 8, 10} A Ս B = {0, 1, -1, 2, 3, -3, 4, 6, 8, 10, 17} 3] Intersection of Sets Example: Set A ={1, 4, 0, -3, -1, 3, 17} Set B = {2, 4, 6, 8, 10} A Ո B = {4} 4] Difference of Two Sets Example: Set A ={1, 4, 0, -3, -1, 3, 17} Set B = {2, 4, 6, 8, 10} A – B = {0, 1, -1, 3, -3, 17} B – A = {2, 6, 8, 10} 5] Complement of a Set Example: U = {1, 2, 3, 4, 5, 6, 7 , 8, 9, 10} Set A ={1, 4, 3, 8, 9} A’ = {2, 5, 6, 7, 10}
Using a C language, write a C program that will display the menu as shown below and will ask the user to pick a choice that will perfom its function. For example, the user choice 1] which is to get the CARDINAL NUMBER OF A SET, the program must ask the user to input any set of numbers before getting its cardinality. Same goes to the other choices. Make the descriptions below as the reference for each choices in the MENU. It is an algebra and I don't have any idea how to code the above mention.
M E N U
1] CARDINAL NUMBER OF A SET
2] UNION OF SETS
3] INTERSECTION OF SETS
4] DIFFERENCE OF 2 SETS
5] COMPLEMENT OF A SET
6] QUIT
Enter choice:
Description in every choices:
1] Cardinal Number of a Set Example:
Set A ={1, 4, 0, -3, -1, 3, 17}
Cardinal Number of Set A = 7
2] Union of Sets Example:
Set A ={1, 4, 0, -3, -1, 3, 17}
Set B = {2, 4, 6, 8, 10}
A Ս B = {0, 1, -1, 2, 3, -3, 4, 6, 8, 10, 17}
3] Intersection of Sets Example:
Set A ={1, 4, 0, -3, -1, 3, 17}
Set B = {2, 4, 6, 8, 10}
A Ո B = {4}
4] Difference of Two Sets Example:
Set A ={1, 4, 0, -3, -1, 3, 17}
Set B = {2, 4, 6, 8, 10}
A – B = {0, 1, -1, 3, -3, 17}
B – A = {2, 6, 8, 10}
5] Complement of a Set Example:
U = {1, 2, 3, 4, 5, 6, 7 , 8, 9, 10}
Set A ={1, 4, 3, 8, 9} A’ = {2, 5, 6, 7, 10}
Step by step
Solved in 4 steps with 3 images