This program is a SET calculator designed to perform various operations on sets. Sets, named SETA to SETF, can hold numbers between 0 and 127. Operations include reading numbers into sets, printing sets, performing union, intersection, subtraction, and symmetric difference operations between sets.
-
Compilation: Compile the program using the provided Makefile.
make
This will generate an executable named
a.out
. -
Execution: Run the program by executing the generated executable.
./a.out
This will start the SET calculator.
-
Commands:
- read_set:
Read numbers into a particular set. Numbers must be positive integers, separated by commas, and terminated with -1. Example:read_set SETA, 3, 1, 22, -1
. - print_set:
Print all numbers inserted into a specified set. Example:print_set SETB
. - union_set:
Perform the union operation between three sets. Example:union_set SETA, SETB, SETC
. - sub_set:
Perform the subtraction operation between three sets. Example:sub_set SETA, SETB, SETC
. - intersect_set:
Perform the intersection operation between three sets. Example:intersect_set SETA, SETB, SETC
. - symdiff_set:
Perform the symmetric difference operation between three sets. Example:symdiff_set SETA, SETB, SETC
. - stop:
Terminate the calculator.
- read_set:
-
Notes:
- The calculator allows whitespace between commands and parameters but does not allow additional text or commas.
- Numbers must be integers between 0 and 127.
- Each command must be followed by the appropriate set names separated by commas.
-
Cleanup: To clean up object files and the executable, run:
make clean
- License: MIT License