Skip to content

The Set Calculator is a C programming language project designed for efficient manipulation of sets. This tool enables users to perform various set operations such as union, intersection, difference etc, providing a versatile and user-friendly interface for set computations.

License

Notifications You must be signed in to change notification settings

DavidS611/Set-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SET Calculator README

Introduction

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.

Usage

  1. Compilation: Compile the program using the provided Makefile.

    make

    This will generate an executable named a.out.

  2. Execution: Run the program by executing the generated executable.

    ./a.out

    This will start the SET calculator.

  3. 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.
  4. 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.
  5. Cleanup: To clean up object files and the executable, run:

    make clean

Local Image

  • License: MIT License

About

The Set Calculator is a C programming language project designed for efficient manipulation of sets. This tool enables users to perform various set operations such as union, intersection, difference etc, providing a versatile and user-friendly interface for set computations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages