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 |
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...
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 |](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F240cea3a-35a5-465e-948a-e623db2715e1%2F766afb3d-0993-441f-9d77-1feb35651c6e%2Fcsg3cm4_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
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 3 steps with 6 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY