Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef WEI_h
- #define WEI_h
- /*WEI contains two objects:
- /* a number, which is identified by itself.*/
- typedef int number;
- /* a point, which is identified by name (a string).*/
- /*the point also contains x and y coordinates, which are numbers. */
- typedef struct{
- char * name;
- number x;
- number y;
- }point;
- /*WEI can be any type of data structure - an array, binary tree ot linked list.*/
- typedef struct WEI;
- /*the function receives no parameters, and returns a pointer to WEI.*/
- WEI* createWEI();
- /*the function receives int, which is the number the user wants to add to the WEI (which was created in the previous function).
- The function does not return anything.*/
- void addNumberToWEI(WEI*, int);
- /*the function receives char* (a string), which is the identifier (the name) of the point the user wants to add to the WEI,
- the two numbers that the point will conatin as x and y coordinates, and a pointer to that WEI, which was created in the previous function.
- The function does not return anything.*/
- void addPointToWEI(WEI*, char*, number, number);
- /*the function receives a pointer to WEI, and three char* (three strings), which are the identifiers (the names) of the three points.
- The function checks if the points are colinear.
- The function returns and int - different number for each result (1. they are colinear. 2. they are not. 3. one (or more) of the points does not exist in the WEI struct. */
- int isCoLinear(WEI*, char*, char*, char*);
- /*the function receives a pointer to WEI, and two char* (two strings), which are the identifiers (the names) of the two points.
- The function calculates the slope of the line connecting the points.
- The function returns the slope or any other value if one of the points does not exist in the WEI struct. */
- double SlopeWEI(WEI*, char*, char*);
- /*the function receives a pointer to WEI, and a number k.
- The function returns all the points which contain the number k. The return data type can be of any type - an array, linked list or a tree. */
- point* PointsContainK(WEI*, number);
- /*the function receives a pointer to WEI, frees the struct and does not return anything.*/
- void destroyWEI(WEI*);
- #endif WEI_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement