Write a program segment to display the content of the linked list.
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
Related questions
Question
![Q2 Answer Q2(a)-Q(d) based on the information given in Figure Q2.
to record daily information of
at Liney Restaurant. The program creates a linked list in
/"This program is
meant
the menu
available
which each node contains data such as menu
name, price per unit,
preparation time, quantity ordered and a pointer. The declaration of
the structures MenuData and MenuNode are given in the program.*/
tinclude <stdio.h>
tinclude <string.h>
tinclude <stdlib.h>
#define SIZE 20
struct Menubata
char menuName (20];
double price PerUnit;
double prepzime;
int quantityordered,
typedef struct Menubata MenuData;
struct MenuNode
MenuData data;
struct MenuNode *next;
typedef struct Menutode MenuNode,
void showPrepTime (MenuNode *fftr):
int main ()
MenuNode *front = NULL, *newNodePtr;
MenuData input Data,
for (int i=l; i<=SIZE, i++)
printf ("\nEnter menu name: "):
gets (inputData.menuName):
printf ("\nEnter price per unit: ");
scanf ("$lf", 5inputData.pricePerUnit);
printf("\nEnter preparation time (hours): "):
scanf ("lf", &input Data.prepTime);
printf ("\nEnter quantity ordered: ");
scanf ("sd", sinputData.quantityordered) :
fflush (stdin):](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fcb300229-c43e-4a30-8491-f670d1fd48cb%2Fc53226da-9b7b-41bb-9c11-620943ce7ea1%2Fr0g89z_processed.png&w=3840&q=75)
Transcribed Image Text:Q2 Answer Q2(a)-Q(d) based on the information given in Figure Q2.
to record daily information of
at Liney Restaurant. The program creates a linked list in
/"This program is
meant
the menu
available
which each node contains data such as menu
name, price per unit,
preparation time, quantity ordered and a pointer. The declaration of
the structures MenuData and MenuNode are given in the program.*/
tinclude <stdio.h>
tinclude <string.h>
tinclude <stdlib.h>
#define SIZE 20
struct Menubata
char menuName (20];
double price PerUnit;
double prepzime;
int quantityordered,
typedef struct Menubata MenuData;
struct MenuNode
MenuData data;
struct MenuNode *next;
typedef struct Menutode MenuNode,
void showPrepTime (MenuNode *fftr):
int main ()
MenuNode *front = NULL, *newNodePtr;
MenuData input Data,
for (int i=l; i<=SIZE, i++)
printf ("\nEnter menu name: "):
gets (inputData.menuName):
printf ("\nEnter price per unit: ");
scanf ("$lf", 5inputData.pricePerUnit);
printf("\nEnter preparation time (hours): "):
scanf ("lf", &input Data.prepTime);
printf ("\nEnter quantity ordered: ");
scanf ("sd", sinputData.quantityordered) :
fflush (stdin):

Transcribed Image Text:newNodePtr = malloc (sizeof (MenuNode) )
newNodePtr->data = inputData;
newNodeFtr->next = NULL;
if (front==NULL)
front = newNodePtr
else
newNodePtr->next = front;
front = newNodePtr;
return 0,
Figure Q2
(a)
Write a program segment to display the content of the linked list.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education