- Joined
- Sep 9, 2021
- Messages
- 9,697
- Reaction score
- 5,256
- Awards
- 33
So in my 200% effort Journal, I have listed source code for a project that would be easy for Agares and Jeliel. The program ran.c is concentrated on safely returning missing/runaways. In order to do this it is necessary down the line a scrolling LED Text functionality. Way down the road from where Im at.
Let me show you a bit of the source, and the function prototypes...
#include <stdio.h>
#include <stdlib.h>
#inlcude <math.h>
#include <ctype.h>
#include <string.h>
/* Pre-processor directives and includes */
/*
Purpose: This program reads two files, runaways and motivational/HelpNumbers.
The goal is to return the runaways to a SAFE environment.
Once a runaway is found, flags are updated to signal to update the returns file,
and unlink the runaway node and insert into the return list.
At that point the flags are read everything updated.
There is an interface engineers will have to create and implement.
*/
/* Abstract Data Type structure definitions */
/* Runner data and stats ADT using runners.dat file */
typedef struct Runner {
char* runner_name[40];
char* runner_age[3];
char* runner_gender[2];
char* runner_contact[20];
} runner;
/* Returns data and stats ADT using returns.dat file */
typedef struct Returns {
char* returns_name[40];
char* returns_age[3];
char* returns_gender[2];
char* returns_contact[20];
} returns;
/* Motivational messages ADT using motivation.txt file */
typedef struct Motivational
{
/* To comply with characters display size for LED text scroll devices */
char* Intro_String[40];
char* Core_Motivational_String[40];
char* List_Help_Num_String[40];
} motivational;
/* SAFE houses and mental health and DPS numbers ADT using SAFE.dat file */
typedef struct SAFENumbers {
char* SAFE_address[40];
char* SAFE_state[3];
char* SAFE_zipcode[6];
char* SAFE_contact[20];
} safenumbers;
/* FOR ENGINEERS TO IMPLEMENT -- interface for LED text scrolling devices */
typedef struct LED_Device_Interface { } LEDDevInterface;
typdef struct Histogram { } histogram;
typedef struct Statistics { } statistics;
typedef struct Set_ADT {
/*
Items are inserted and deleted, there is no inherent order in the
items in a given set. Merge_set, however does a merge-sort on the
items in the given set(s). Before any call is made to a set operation,
The set has been declared and a constructor has been applied.
The '==' and '<<' operators apply to values of ItemType.
} set_adt;
typedef struct set_adt set;
typedef struct List
{
}list_adt;
typedef struct list_adt list;
Returns="ReturnsData.txt"
OFile="RandRStatResults.txt"
Runner runaway_list(list L);
list L, runaway_list, return_list, safe_list;
set S, S1, S2, MergedSet, joinedSet;
int numSetItems;
/* Function Prototypes */
Void setMakeEmpty(set S);
boolean setIsEmpty(set S);
boolean setIsFull(set S);
int setCardinality(set S);
int setUnion(set S1,S2);
int setIntersection(set S1, S2);
int setDifference(set S1,S2);
set setStore(set S; int item);
int setDeleteItem(set S, int item);
set setCreate(set S);
set setJoin (set S, S1, S2, joinedSet);
set setMerge(set S1, S2, mergedSet);
set setPrintSet (set S);
int setDestroy(set S);
FILE* chomp_file(&filename, &mode, 256);
FILE* slurp_file(&filename, &mode, 4196);
returns runawayfound();
runner runawayreturn();
void motivational();
void` helpresources();
list return_list():
list setItem_to_Node();
void print_stats(void);
void print_histogram(returns R1, runners R2, histogram H){ }
What I want to do is to merge set ADT functionality into what appears to be in need of an array of records or a cicular linked list, and perhaps a graph of the found sites. Would appreciate any and all advice.
Thanks,
Diluculo, Nocte Ac Die
There is the possibility of the data types being the issue, as variable values of the same type should be able to be passed through different structures, as long as the return type is the same data type as the variable value.
There is also the possibility the types are incompatible, in which case there would be different functionality controlled in main.
I do like my idea of implementing a merge sort in the setMerge function. That could be useful as a bridge between runaways and returns.
Thoughts?
Let me show you a bit of the source, and the function prototypes...
#include <stdio.h>
#include <stdlib.h>
#inlcude <math.h>
#include <ctype.h>
#include <string.h>
/* Pre-processor directives and includes */
/*
Purpose: This program reads two files, runaways and motivational/HelpNumbers.
The goal is to return the runaways to a SAFE environment.
Once a runaway is found, flags are updated to signal to update the returns file,
and unlink the runaway node and insert into the return list.
At that point the flags are read everything updated.
There is an interface engineers will have to create and implement.
*/
/* Abstract Data Type structure definitions */
/* Runner data and stats ADT using runners.dat file */
typedef struct Runner {
char* runner_name[40];
char* runner_age[3];
char* runner_gender[2];
char* runner_contact[20];
} runner;
/* Returns data and stats ADT using returns.dat file */
typedef struct Returns {
char* returns_name[40];
char* returns_age[3];
char* returns_gender[2];
char* returns_contact[20];
} returns;
/* Motivational messages ADT using motivation.txt file */
typedef struct Motivational
{
/* To comply with characters display size for LED text scroll devices */
char* Intro_String[40];
char* Core_Motivational_String[40];
char* List_Help_Num_String[40];
} motivational;
/* SAFE houses and mental health and DPS numbers ADT using SAFE.dat file */
typedef struct SAFENumbers {
char* SAFE_address[40];
char* SAFE_state[3];
char* SAFE_zipcode[6];
char* SAFE_contact[20];
} safenumbers;
/* FOR ENGINEERS TO IMPLEMENT -- interface for LED text scrolling devices */
typedef struct LED_Device_Interface { } LEDDevInterface;
typdef struct Histogram { } histogram;
typedef struct Statistics { } statistics;
typedef struct Set_ADT {
/*
Items are inserted and deleted, there is no inherent order in the
items in a given set. Merge_set, however does a merge-sort on the
items in the given set(s). Before any call is made to a set operation,
The set has been declared and a constructor has been applied.
The '==' and '<<' operators apply to values of ItemType.
} set_adt;
typedef struct set_adt set;
typedef struct List
{
}list_adt;
typedef struct list_adt list;
Returns="ReturnsData.txt"
OFile="RandRStatResults.txt"
Runner runaway_list(list L);
list L, runaway_list, return_list, safe_list;
set S, S1, S2, MergedSet, joinedSet;
int numSetItems;
/* Function Prototypes */
Void setMakeEmpty(set S);
boolean setIsEmpty(set S);
boolean setIsFull(set S);
int setCardinality(set S);
int setUnion(set S1,S2);
int setIntersection(set S1, S2);
int setDifference(set S1,S2);
set setStore(set S; int item);
int setDeleteItem(set S, int item);
set setCreate(set S);
set setJoin (set S, S1, S2, joinedSet);
set setMerge(set S1, S2, mergedSet);
set setPrintSet (set S);
int setDestroy(set S);
FILE* chomp_file(&filename, &mode, 256);
FILE* slurp_file(&filename, &mode, 4196);
returns runawayfound();
runner runawayreturn();
void motivational();
void` helpresources();
list return_list():
list setItem_to_Node();
void print_stats(void);
void print_histogram(returns R1, runners R2, histogram H){ }
What I want to do is to merge set ADT functionality into what appears to be in need of an array of records or a cicular linked list, and perhaps a graph of the found sites. Would appreciate any and all advice.
Thanks,
Diluculo, Nocte Ac Die
Post automatically merged:
There is the possibility of the data types being the issue, as variable values of the same type should be able to be passed through different structures, as long as the return type is the same data type as the variable value.
There is also the possibility the types are incompatible, in which case there would be different functionality controlled in main.
I do like my idea of implementing a merge sort in the setMerge function. That could be useful as a bridge between runaways and returns.
Thoughts?
Last edited: