1 #include // Do not edit these directives or add another. 2 #include #include 4 #include 5 6 #define MAX 1000 // Do not edit this macro. 8 typedef struct // Do not edit this struct. 9 { unsigned long restaurant_id; char restaurant_name[15]; char description[127]; double rate; char cuisine[ 31); unsigned short opening_year; unsigned long capacity; char city[31]; 10 11 12 13 14 15 16 17 18 char address[63]; char owner(31]; 20 } RECORD t, RECORD; 19 21 22 23 24 /* IMPLEMENT YOUR FUNCTIONS HERE */ 25 void find_by_opening_year(unsigned short opening year, RECORD *restaurant_array, unsigned long size, unsigned long start, unsigned long end, unsigned long *p_found_num, RECORD **p_found_restaurants) 26 { 27 /* num <- find the number of RECORDS with given release_year between start and end in restaurant_array restaurants <- NULL if num ! 0 then restaurants - allocate an array of RECORDS of size num put the RECORDS with given opening_year between start and end in restaurant_array into restaurants endif 28 29 30 31 32 33 *p_found_num <- num // return the number of RECORDS via pointer parameter *p_found_restaurants <- restaurants // return the array of found RECORDS via pointer parameter 34 35 36 */ 37 } 38 39 |

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!!!

ACCORDING TO THE INSTRUCTIONS GIVEN, WE WILL WRITE THE CODE..PLEASE COULD YOU HELP?

restaurant.c ) No Selection
1
#include <stdio.h> // Do not edit these directives or add another.
#include <stdlib.h>
3
#include <string.h>
4
#include <time.h>
6.
#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];
char description[127];
10
11
12
13
double rate;
14
char cuisine[31];
unsigned short opening_year;
unsigned long capacity;
char city[31];
char address[63];
char owner[31];
15
16
17
18
19
20 } RECORD_t, *RECORD;
21
22
23
24
/* IMPLEMENT YOUR FUNCTIONS HERE */
25
void find_by_opening_year(unsigned short opening_year, RECORD *restaurant_array, unsigned long size, unsigned long start, unsigned long end, unsigned long *p_found_num, RECORD **p_found_restaurants)
26
{
27
/*
28
num <- find the number of RECORDS with given release_year between start and end in restaurant_array
29
restaurants <- NULL
30
if num != 0 then
restaurants <- allocate an array of RECORDS of size num
put the RECORDS with given opening_year between start and end in restaurant_array into restaurants
31
32
33
endif
34
*p_found_num <- num // return the number of RECORDS via pointer parameter
35
*p_found_restaurants <- restaurants // return the array of found RECORDS via pointer parameter
36
*/
37
}
38
39 |
Transcribed Image Text:restaurant.c ) No Selection 1 #include <stdio.h> // Do not edit these directives or add another. #include <stdlib.h> 3 #include <string.h> 4 #include <time.h> 6. #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]; char description[127]; 10 11 12 13 double rate; 14 char cuisine[31]; unsigned short opening_year; unsigned long capacity; char city[31]; char address[63]; char owner[31]; 15 16 17 18 19 20 } RECORD_t, *RECORD; 21 22 23 24 /* IMPLEMENT YOUR FUNCTIONS HERE */ 25 void find_by_opening_year(unsigned short opening_year, RECORD *restaurant_array, unsigned long size, unsigned long start, unsigned long end, unsigned long *p_found_num, RECORD **p_found_restaurants) 26 { 27 /* 28 num <- find the number of RECORDS with given release_year between start and end in restaurant_array 29 restaurants <- NULL 30 if num != 0 then restaurants <- allocate an array of RECORDS of size num put the RECORDS with given opening_year between start and end in restaurant_array into restaurants 31 32 33 endif 34 *p_found_num <- num // return the number of RECORDS via pointer parameter 35 *p_found_restaurants <- restaurants // return the array of found RECORDS via pointer parameter 36 */ 37 } 38 39 |
Expert Solution
steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
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