C#代写:CS3160-Set

Purpose

The purpose of this request is to create a C# class representing sets of integers in the range 0 to 50 inclusive.
You should work in your groups (2 members). If your partner is not present in class each will need to complete the request on your own by the due date/time.

Always bring to class

  1. Deitel’s book.
  2. This request grade sheet for this lab already printed out.
  3. USB Flash drive(s) or other storage media.
  4. Your laptop with Microsoft Visual Studio 2015.

Mandatory Instructions

Begin by creating a solution folder on the ZIP disk, USB flash drive, or your laptop’s HD. The folder’s name should be one or two last names followed by Lab1 (e.g. Smith-Lab1 or Smith-Jones-Lab1) if both group members are working on the solution.

You will create a file IntegerSet.cs that will be compiled into IntegerSet.dll. Begin by creating a makefile that you will use for this request. The application created by the makefile should be called Lab1.exe. Also implement the “clean” target so that you can type “make clean” for the current directory. Use the command-line compiler csc for this request. Do not use Visual Studio GUI!

Define the IntegerSet class in the file IntegerSet.cs. Use the same namespace (Set) that is used for the main program. Remember to make your class public. Hint: Because the only integers allowed are those in the range 0 to 50 inclusive, you don’t really need the overhead of linked lists to implement the set. Use a bool array of length 51 to represent the set. If the value of position i is true, that means that i is in the set. (Example: If arr[5] is true, that means that 5 is in the set.) These are the public member functions of IntegerSet

You might find it convenient to define one or more private functions for use in your function implementations. Make sure to document your code and to use meaningful variable names.

When you have fully debugged your code, upload your compressed solution folder to Canvas (both group members should upload the solution). Your folder should contain only three files (App.cs, IntegerSet.cs, makefile) for this request.
Sample output for this program is provided below

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
A is: { 3 4 11 21 29 }
B is: { 1 2 3 4 }

Union of A and B is: { 1 2 3 4 11 21 29 }

Intersection of A and B is: { 3 4 }

Set A is not equal to set B

Copying a to b...
Set A is equal to set B

Inserting 33 into set A...
Set A is now: { 3 4 11 21 29 33 }

Deleting 33 from set A...
Set A is now: { 3 4 11 21 29 }

Enter set E:
Enter an element (Enter to end): 5
Enter an element (Enter to end): 6
Enter an element (Enter to end): 7
Enter an element (Enter to end): 6
Enter an element (Enter to end): 5
Enter an element (Enter to end):

Set e is: { 5 6 7 }
Emptying set e...
Set e is: { empty }

Code Documentation

Each of your source files should contain a documentation header with description, author name, class information. Each function should have a documentation header with minimally function name, description, parameters, return value. Use proper program style at all times which means indentation, alignment, and whitespace. Utilize self-documenting code which means use mnemonic, i.e., meaningful variable/function/namespace/class names, etc.

What to turn in?

Submit compressed (.zip) solution folder via Canvas.
In your solution folder make sure that all necessary files to compile/link/execute your projects are provided.
Here are some files that may be required

  1. All required C# source files (.cs)
  2. makefile (if the solution requires it)
  3. The entire Visual Studio 2015 solution folder (if the solution requires it)