# Thread: C Program

1. ## C Program

I'm not in this class anymore, but plan on taking a summer course for it and want to get myself as prepared as possible. I am just a bit confused and what the professor wanted this program to do, and was wondering if someone could understand what he wanted. Here are the instructions :

Code:
`In this assignment, students will implement a common representation of sets.  In completing the assignment students will demonstrate that they can`
Code:
```Implement a simple abstract data typeDesign, implement, compile and execute a small software project in C using a Linux environmentWrite, compile and run C software that includes multiple C files and a .h fileMake use of bitwise operators, &, |, and ^, in a C programDesign and implement a “driver”, in C,  to test their softwareFor our purposes, a set is an arbitrary collection of elements, which may be real or imaginary, physical or abstract. In mathematics, sets are usually composed of abstract things like numbers and points, but one can also talk about sets of trees, UNT students, cars, or television shows. In many applications, the elements are never defined, but are left as abstractions that could be represented in many different ways in the human brain, on a piece of paper, or in computer storage.
Set notation typically uses curly braces to enclose a set specification. For small, finite sets, the specification of a set can be an exhaustive list of all its elements:
{13, 87, 913, 47, 19}.

This specifies a set consisting of the five integers 13, 87, 913, 47 and 19. Since the order of listing the elements is immaterial, the following specification is equivalent to the one above:

{87, 47, 19, 193, 13}.

Some additional definitions of set operations are useful, namely:
Empty Set --- the empty set is that set containing no elements, often denoted as {}
Set Union --- the union of two sets, s1 and s2, includes all elements included in either or both of s1 or s2.  Thus the union of sets {21, 86, 43, 19} and {43, 52, 19} is the set {21, 86, 43, 19, 13, 52}.  Note the lack of duplicate elements in the resultant set.
Set Intersection --- the intersection  of two sets, s1 and s2 includes all elements that are included in both s1 and s2. Thus the intersection of sets {21, 86, 43, 19} and {43, 52, 19} is the set {19, 43}.To proceed we must first define an abstract data type for sets.  An abstract data type consists of two things, a name of the data type and a list of operations defined for that data type.   The name of our abstract data type will be set.  The list of operations defined for our set abstract data type includes:
clear a set --- make the set an empty set.add2Set --- adds an element to the setdeleteFromSet  --- removes an element from the setisMember --- returns true is a specified element is a member of the specified setprintSet --- prints a list of all element included in a setsetUnion --- performs the set union of two input sets and returns the resulting setsetIntersection --- performs the set intersection of two input sets and returns the resulting set.ASSIGNMENT SPECIFICS
The “universe” of elements for the sets (in this assignment) are integers 0 .. 31You should represent sets as unsigned integer numbers, where each bit of an unsigned number represents one possible element of a set. Thus, we have 32 possible set elements (0, 1, … 31) and 32 bit positions in an unsigned int variable (also 0, 1, … 31).  For purposes of this program it doesn’t matter whether you “name” the lowest order bit of an unsigned int as 0 (and the highest order bit as 31)  or if you “name” the highest order bit 0 and lowest 31. In either case we will define a ‘1’ in bit position i to mean that element i is a member of the set represented by that unsigned int.   Thus, the following bit representation would represents the set {19, 3, 31, 12, 7}.1

1

1

1

1

Bit 31    …                                                                                                                  0
Use the set.h file provided to represent a C “specification” of the set abstract data type.  (Instructions will be provided in class as to where and how you should access set.h)Write your own set.c and driver.c files, each of which include set.h.  Set.c should implement the functions specified in set.h.  Driver.c should provide a main function (and other functions as you feel appropriate) to test your set implementation.  It is YOUR responsibility to demonstrate (by your program output) that your program is working correctly.DO NOT change set.h but rather make sure that your set.c correctly implements the functions listed in set.h.  This is important, because, in addition to your being graded on your program output’s demonstration that your set implementation is correct, we will  replace your driver.c with our own and test your set implementation with our own example data.```

2. Yes I can understand what is being asked for. Where's your code?

"Next!"...

3. I am just a bit confused and what the professor wanted this program to do, and was wondering if someone could understand what he wanted.
If you're asking for someone to paraphrase the assignment, I don't think that's going to happen. But if you have a specific question....

Popular pages Recent additions