How do I code the C code for the main.c file to accomplish the following tasks outlined in the assignment (see images) to produce a similar palindromes output?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question

C PROGRAM!!!!

How do I code the C code for the main.c file to accomplish the following tasks outlined in the assignment (see images) to produce a similar palindromes output?

main.c
Main function code
lab5.c
Code specific to carrying out this lab exercise
lab5.h
Header definitions for functions specific to carrying out this lab exercise
dynarray.c A dynamic array set of structures and functions for stacks and queues
dynarray.h Header definitions for functions used for stacks and queues
makefile
A makefile that creates the "queue" executable easier (including clean)
Here is a quick reference to the functions provided in dynarray.c:
typedef dynarray_t;
// dynamic array struct
/* Basic/common operations */
// initialize struct
// free struct
void
dynarray_init
dynarray_free
size_t dynarray_size
(dynarray_t *a);
(dynarray_t *a);
(dynarray_t *a);
size_t dynarray_is_empty(dynarray_t *a);
void
// return element count
// return true if empty
/* Stack operations * /
1
// add to back
// remove from back
// return back
void
dynarray_push (dynarray_t *a, data_t item);
data_t dynarray_pop (dynarray_t *a);
data_t dynarray_top (dynarray_t *a);
/* Queue operations * /
// add to back
// remove from front
// return front
void
dynarray_enqueue (dynarray_t *a, data_t item);
data_t dynarray_dequeue (dynarray_t *a);
data_t dynarray_front
(dynarray_t *a);
In addition, you may find the following functions from ctype.h useful in this lab:
int tolower (int c)
Converts c to its lowercase equivalent. If no conversion is possible, the value returned is
unchanged. NOTE: For the purposes of this lab, you may use this function as if it accepts and
returns a char.
int isdigit (int c)
Returns non-zero integer (true) if c is a decimal digit (0-9); otherwise it returns zero (false).
Transcribed Image Text:main.c Main function code lab5.c Code specific to carrying out this lab exercise lab5.h Header definitions for functions specific to carrying out this lab exercise dynarray.c A dynamic array set of structures and functions for stacks and queues dynarray.h Header definitions for functions used for stacks and queues makefile A makefile that creates the "queue" executable easier (including clean) Here is a quick reference to the functions provided in dynarray.c: typedef dynarray_t; // dynamic array struct /* Basic/common operations */ // initialize struct // free struct void dynarray_init dynarray_free size_t dynarray_size (dynarray_t *a); (dynarray_t *a); (dynarray_t *a); size_t dynarray_is_empty(dynarray_t *a); void // return element count // return true if empty /* Stack operations * / 1 // add to back // remove from back // return back void dynarray_push (dynarray_t *a, data_t item); data_t dynarray_pop (dynarray_t *a); data_t dynarray_top (dynarray_t *a); /* Queue operations * / // add to back // remove from front // return front void dynarray_enqueue (dynarray_t *a, data_t item); data_t dynarray_dequeue (dynarray_t *a); data_t dynarray_front (dynarray_t *a); In addition, you may find the following functions from ctype.h useful in this lab: int tolower (int c) Converts c to its lowercase equivalent. If no conversion is possible, the value returned is unchanged. NOTE: For the purposes of this lab, you may use this function as if it accepts and returns a char. int isdigit (int c) Returns non-zero integer (true) if c is a decimal digit (0-9); otherwise it returns zero (false).
Palindromes
A palindrome is a string that is identical to itself when reversed. For example, "madam", "dad",
and "abba" are palindromes. Note: the empty string is a palindrome, as is every string of length
one.
Write some code in the main () function to accomplish the following tasks:
Having written code to extract data from the keyboard (stdin) in Lab 3, reuse that code
to prompt the user to enter a string between 0 and 255 characters in length. You should
ignore whitespace and punctuation, and all comparisons should be case-insensitive.
Process the entries from the keyboard and store them in the queue ADT provided in the
lab 5 code package.
Use the is_palindrome () function ADT provided to implement a simple palindrome
verification of the data entered. Here is the signature and documentation for the function:
bool is palindrome (char *text)
Return true if text is a palindrome, false otherwise.
Turn in your commented program and a screen shot (script) of the execution run of the
program. Include some sample tests in your captured code run. Examples of valid palindromes:
"a"
"aa"
"aaa"
"aba"
"abba"
"Тасо сat"
"Madam, I'm Adam"
"A man, a plan, a canal: Panama"
"Doc, note: I dissent. A fast never prevents a fatness. I diet on cod."
Transcribed Image Text:Palindromes A palindrome is a string that is identical to itself when reversed. For example, "madam", "dad", and "abba" are palindromes. Note: the empty string is a palindrome, as is every string of length one. Write some code in the main () function to accomplish the following tasks: Having written code to extract data from the keyboard (stdin) in Lab 3, reuse that code to prompt the user to enter a string between 0 and 255 characters in length. You should ignore whitespace and punctuation, and all comparisons should be case-insensitive. Process the entries from the keyboard and store them in the queue ADT provided in the lab 5 code package. Use the is_palindrome () function ADT provided to implement a simple palindrome verification of the data entered. Here is the signature and documentation for the function: bool is palindrome (char *text) Return true if text is a palindrome, false otherwise. Turn in your commented program and a screen shot (script) of the execution run of the program. Include some sample tests in your captured code run. Examples of valid palindromes: "a" "aa" "aaa" "aba" "abba" "Тасо сat" "Madam, I'm Adam" "A man, a plan, a canal: Panama" "Doc, note: I dissent. A fast never prevents a fatness. I diet on cod."
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education