can I code it in Dev C++? using Use one-dimensional array and my solution in a class structure?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

How can I code it in Dev C++? using Use one-dimensional array and my solution in a class structure?

1. Union and Intersection of Two Sets
A
B
3
|
5
10
8
6
2
7
Venn diagram
A={1,3, 4, 5, 6, 7, 9, 10}
B={2, 5, 6, 7, 8, 10}
AUB={1,2,3,4,5,6,7,8,9,10}
ANB={5,6,10}
Create a program that will perform the union and intersection of two input sets of
integer numbers. Use one-dimensional array to represent your set. Your program must
have the following operations in linear lists:
Storing new element in an array
Sorting the elements of an array
Merging two sets
Retrieving elements in an array
Present your solution in a class structure. When printing the elements of an array, make
no sure that there is no duplicate value. Use the following variables in your solution:
N with constant value 10 for maximum size of array
A[N] and B[N] represents the two sets
AUB[N*2] holds the elements for union of A and B
AnB[N] holds the elements for intersection of A and B
Transcribed Image Text:1. Union and Intersection of Two Sets A B 3 | 5 10 8 6 2 7 Venn diagram A={1,3, 4, 5, 6, 7, 9, 10} B={2, 5, 6, 7, 8, 10} AUB={1,2,3,4,5,6,7,8,9,10} ANB={5,6,10} Create a program that will perform the union and intersection of two input sets of integer numbers. Use one-dimensional array to represent your set. Your program must have the following operations in linear lists: Storing new element in an array Sorting the elements of an array Merging two sets Retrieving elements in an array Present your solution in a class structure. When printing the elements of an array, make no sure that there is no duplicate value. Use the following variables in your solution: N with constant value 10 for maximum size of array A[N] and B[N] represents the two sets AUB[N*2] holds the elements for union of A and B AnB[N] holds the elements for intersection of A and B
Here is the sample output of the program. The Bold and Underlined text denotes for a
user input.
Enter number of elements for set A (max 18): 8
A[0] - 9
A[1] - Z
A[2] = 3
A[3]
= 10
A[4]
= 1
A[5] = 5
A[6] = 6
A[7] = 4
Enter number of elements for set B (max 10): 6
B[e] = 10
B[1] = 8
B[2] = Z
B[3] = 6
B[4] = 5
= 2
B[5]
Output
Az(1, 3, 4, 5, 6, 7, 9, 18}
Ba{2, 5, 6, 7, 8, 10}
AUB={1,2,3,4,5,6,7,8,9,10}
AnBs(5,6,10)}
Transcribed Image Text:Here is the sample output of the program. The Bold and Underlined text denotes for a user input. Enter number of elements for set A (max 18): 8 A[0] - 9 A[1] - Z A[2] = 3 A[3] = 10 A[4] = 1 A[5] = 5 A[6] = 6 A[7] = 4 Enter number of elements for set B (max 10): 6 B[e] = 10 B[1] = 8 B[2] = Z B[3] = 6 B[4] = 5 = 2 B[5] Output Az(1, 3, 4, 5, 6, 7, 9, 18} Ba{2, 5, 6, 7, 8, 10} AUB={1,2,3,4,5,6,7,8,9,10} AnBs(5,6,10)}
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY