Write the showPrepTime () function to display all names of the menu in the linked list with their corresponding preparation time.

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
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):
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):
newNodePtr = malloc (sizeof (MenuNode) );
newNodePtr->data input Data,
newNodeFtr->next = NULL;
if (front==NULL)
front = newNodePtr;
else
newNodePtr->next = front;
front = newNode Ptr
return 0;
Figure Q2
(d)
Write the showPrepTime () function to display all names of the menu in the
linked list with their corresponding preparation time.
Transcribed Image Text:newNodePtr = malloc (sizeof (MenuNode) ); newNodePtr->data input Data, newNodeFtr->next = NULL; if (front==NULL) front = newNodePtr; else newNodePtr->next = front; front = newNode Ptr return 0; Figure Q2 (d) Write the showPrepTime () function to display all names of the menu in the linked list with their corresponding preparation time.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
List
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