Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

main.c stack_functions.h stack_functions.c queue_functions.h queue_functions.c spec #include stdio.h> #include stack_functions.h #include queue_functions.h #define MAX_BUFFER 1024 int main(int argc, char argv[]) { // utilize fopen function

main.c image text in transcribed
stack_functions.h
image text in transcribed
stack_functions.c
image text in transcribed
queue_functions.h
image text in transcribed
queue_functions.c
image text in transcribed
spec
image text in transcribed
image text in transcribed
\#include stdio.h> \#include "stack_functions.h" \#include "queue_functions.h" \#define MAX_BUFFER 1024 int main(int argc, char argv[]) \{ // utilize fopen function // implement those requirements return ; \} \#ifndef STACK_FUNCTIONS_H \#define STACK_FUNCTIONS_H \#define MAX_WORDS 100 typedef struct \{ char* items[MAX_WORDS ] ; int top; \} Stack; void initializeStack (Stack* stack); int isStackEmpty(Stack* stack); void push(Stack* stack, char* item); char* pop (Stack* stack); void printLowerCaseWordsReverse (Stack* stack); \#endif \#include \#define MAX_LENGTH 20 \#define MAX_WORDS 100 typedef struct \{ char* items[MAX_WORDS]; int top; \} Stack; void initializeStack (Stack* stack) \{ \} int isStackEmpty(Stack* stack) \{ \} void push(Stack* stack, char* item) \{ \} char* pop(Stack* stack) \{ \} void printLowerCaseWordsReverse(Stack* stack) \{ // Implement this function to print lowercase words in reverse order \} \#ifndef QUEUE_FUNCTIONS_H \#define QUEUE_FUNCTIONS_H \#define MAX_NUMBERS 100 typedef struct \{ char* items[MAX_NUMBERS]; int front, rear; \} Queue ; void initializeQueue (Queue* queue); int isQueueEmpty (Queue* queue); void enqueue (Queue* queue, char* item); char* dequeue (Queue* queue); void printNumbersAndSum (Queue* queue); \#endif \#include \#include \#define MAX_LENGTH 20 \#define MAX_NUMBERS 100 typedef struct \{ char* items[MAX_NUMBERS] ; int front, rear; \} Queue ; void initializeQueue(Queue* queue) \{ \} int isQueueEmpty(Queue* queue) \{ \} void enqueue(Queue* queue, char* item) \{ \} char* dequeue (Queue* queue) \{ \} void printNumbersAndSum (Queue* queue) \{ // Implement this function to print numbers and their summation \} There are data types discussed in class: stack and queue. Implement a series of functions discussed in class and put them in two files, one for each, with an array of 100 elements. Based on these functions, your program shall read a file of string, and print out two files as followings: 1. apply the stack functions to print out the words of lower case in reverse order and give the number of these words totally at the end, and 2. apply the queue functions to print out the numbers (including both integer and real) as their order in the file, and their summation at the end also. The character which is not lower case, or part of a number is deleted directly, and the length of a word is less than 20 . You need to write 5 program, stack.c stack.h queue.c queue.h main.c In your main.c, you need to include stack and queue The input should be a .txt file, process the input and output 2 .txt files After you finish your program, open your terminal and key in the following statement: gcc -o main main.c stack_functions.c queue_functions.c /main "file path" Input txt file If you don't know how to do we have an example Input.txt format: IQWER_2F3iS4FLASH Lev100.oQOQLL3.31 Asc 112PIEQUALTO3.14159 Output.txt format: (stack) i 1 love 4 es 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students explore these related Databases questions