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?

## Lab Exercise Reference Guide

### File Descriptions:
- **main.c**: Contains the main function code.
- **lab5.c**: Includes code specific to carrying out this lab exercise.
- **lab5.h**: Header definitions for functions specific to carrying out this lab exercise.
- **dynarray.c**: Includes 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 facilitates the creation of the “queue” executable (including clean commands).

### Functions in dynarray.c

#### Dynamic Array Struct Definition:
```c
typedef dynarray_t;
```
This line creates a type definition for a dynamic array struct referred to as `dynarray_t`.

### Basic/Common Operations:
1. **Initialize Struct**:
    ```c
    void dynarray_init(dynarray_t *a);
    ```
    - Initializes the dynamic array structure.

2. **Free Struct**:
    ```c
    void dynarray_free(dynarray_t *a);
    ```
    - Frees the memory allocated for the dynamic array structure.

3. **Return Element Count**:
    ```c
    size_t dynarray_size(dynarray_t *a);
    ```
    - Returns the count of elements in the dynamic array.

4. **Check if Empty**:
    ```c
    size_t dynarray_is_empty(dynarray_t *a);
    ```
    - Returns true if the dynamic array is empty.

### Stack Operations:
1. **Add to Back**:
    ```c
    void dynarray_push(dynarray_t *a, data_t item);
    ```
    - Adds an element to the back of the stack.

2. **Remove from Back**:
    ```c
    data_t dynarray_pop(dynarray_t *a);
    ```
    - Removes an element from the back of the stack.

3. **Return Back**:
    ```c
    data_t dynarray_top(dynarray_t *a);
    ```
    - Returns the element at the back of the stack.

### Queue Operations:
1. **Add to Back**:
    ```c
    void dynarray_enqueue(dynarray_t *a, data_t item);
    ```
    - Adds an element to the back of the queue.

2. **Remove from Front**:
    ```c
    data
Transcribed Image Text:## Lab Exercise Reference Guide ### File Descriptions: - **main.c**: Contains the main function code. - **lab5.c**: Includes code specific to carrying out this lab exercise. - **lab5.h**: Header definitions for functions specific to carrying out this lab exercise. - **dynarray.c**: Includes 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 facilitates the creation of the “queue” executable (including clean commands). ### Functions in dynarray.c #### Dynamic Array Struct Definition: ```c typedef dynarray_t; ``` This line creates a type definition for a dynamic array struct referred to as `dynarray_t`. ### Basic/Common Operations: 1. **Initialize Struct**: ```c void dynarray_init(dynarray_t *a); ``` - Initializes the dynamic array structure. 2. **Free Struct**: ```c void dynarray_free(dynarray_t *a); ``` - Frees the memory allocated for the dynamic array structure. 3. **Return Element Count**: ```c size_t dynarray_size(dynarray_t *a); ``` - Returns the count of elements in the dynamic array. 4. **Check if Empty**: ```c size_t dynarray_is_empty(dynarray_t *a); ``` - Returns true if the dynamic array is empty. ### Stack Operations: 1. **Add to Back**: ```c void dynarray_push(dynarray_t *a, data_t item); ``` - Adds an element to the back of the stack. 2. **Remove from Back**: ```c data_t dynarray_pop(dynarray_t *a); ``` - Removes an element from the back of the stack. 3. **Return Back**: ```c data_t dynarray_top(dynarray_t *a); ``` - Returns the element at the back of the stack. ### Queue Operations: 1. **Add to Back**: ```c void dynarray_enqueue(dynarray_t *a, data_t item); ``` - Adds an element to the back of the queue. 2. **Remove from Front**: ```c data
## 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:

- **Prompt for User Input**: 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 User Input**: Process the entries from the keyboard and store them in the queue ADT provided in the lab 5 code package.

- **Check for Palindromes**: 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:

```cpp
bool is_palindrome(char *text)
```

Return `true` if `text` is a palindrome, `false` otherwise.

Turn in your commented program and a screenshot (`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"
"Taco cat"
"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: - **Prompt for User Input**: 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 User Input**: Process the entries from the keyboard and store them in the queue ADT provided in the lab 5 code package. - **Check for Palindromes**: 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: ```cpp bool is_palindrome(char *text) ``` Return `true` if `text` is a palindrome, `false` otherwise. Turn in your commented program and a screenshot (`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" "Taco cat" "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
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