RECORD delete (unsigned long restaurant_id, RECORD *restaurant_array, unsigned long *p_size) { index <- find the index of the RECORD with given restaurant_id in restaurant_array if index is valid then rec <- restaurant_array[index] else rec <- NULL endif return rec */

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

IN C LANGUAGE!!

WRITE THE FUNCTION ACCORDING TO THE INSTRUCTIONS GIVEN...I DIDNT..

< >
C restaurant.c
c restaurant.c ) No Selection
1
#include <stdio.h> // Do not edit these directives or add another.
2 #include <stdlib.h>
3 #include <string.h>
4
#include <time.h>
#define MAX 1000 // Do not edit this macro.
7
8 typedef struct // Do not edit this struct.
9.
{
unsigned long restaurant_id;
char restaurant_name[15];
10
11
12
char description[127];
13
double rate;
14
char cuisine[31];
unsigned short opening_year;
unsigned long capacity;
char city[31];
char address[63];
15
16
17
18
19
char owner[31];
20
} RECORD_t, *RECORD;
21
22
23
24
/* IMPLEMENT YOUR FUNCTIONS HERE */
25
26
27
28
29
RECORD delete (unsigned long restaurant_id, RECORD *restaurant_array, unsigned long *p_size)
30 {
31
/*
index <- find the index of the RECORD with given restaurant_id in restaurant_array
if index is valid then
32
33
34
rec <- restaurant_array[index]
35
else
36
rec <- NULL
37
endif
38
return rec
39
*/
40
}
41 |
Transcribed Image Text:< > C restaurant.c c restaurant.c ) No Selection 1 #include <stdio.h> // Do not edit these directives or add another. 2 #include <stdlib.h> 3 #include <string.h> 4 #include <time.h> #define MAX 1000 // Do not edit this macro. 7 8 typedef struct // Do not edit this struct. 9. { unsigned long restaurant_id; char restaurant_name[15]; 10 11 12 char description[127]; 13 double rate; 14 char cuisine[31]; unsigned short opening_year; unsigned long capacity; char city[31]; char address[63]; 15 16 17 18 19 char owner[31]; 20 } RECORD_t, *RECORD; 21 22 23 24 /* IMPLEMENT YOUR FUNCTIONS HERE */ 25 26 27 28 29 RECORD delete (unsigned long restaurant_id, RECORD *restaurant_array, unsigned long *p_size) 30 { 31 /* index <- find the index of the RECORD with given restaurant_id in restaurant_array if index is valid then 32 33 34 rec <- restaurant_array[index] 35 else 36 rec <- NULL 37 endif 38 return rec 39 */ 40 } 41 |
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY