Table of Contents

Set Program: Part 1

Overview

With our covering of sets, it makes sense to reinforce those concepts through code. I'd like you to develop the beginnings of a program that will manipulate sets.

Criteria

Write a program that does the following:

Assumptions

You may develop the program with the following assumptions in mind:

Example Output

You resulting program should operate in a manner similar to the following (output doesn't have to exactly match):

lab46:~/src/discrete/p03$ ./setprog
Enter a unique value (-1 to quit): 1
Enter a unique value (-1 to quit): 2
Enter a unique value (-1 to quit): 4
Enter a unique value (-1 to quit): 8
Enter a unique value (-1 to quit): 16
Enter a unique value (-1 to quit): 4
Duplicate Value Detected! Discarding...
Enter a unique value (-1 to quit): 32
Enter a unique value (-1 to quit): 64
Enter a unique value (-1 to quit): -1

Set Built. Displaying...

A = { 1, 2, 4, 8, 16, 32, 64 }

lab46:~/src/discrete/p03$ 

Submission

I will be evaluating your program one-on-one at the start of class, when this is due. If you do not show up, you will not receive credit any for it.

Please be sure your program also meets the following criteria: