1. How many string entries can sentence store? 2. How many char entries can strB store? 3. How many char entries can sentence[4] store? 4. How many double entries can aValues[MAX_A] store? 5. What is the value of aValues[2]?  [Hint:  the value is an address] 6. How many bytes are allocated to sentence? 7. What is the address associated to the last byte for sentence? 8. How many bytes of memory are allocated to aValues? 9. What is the starting address of the last double element in aValues?

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
100%

1. How many string entries can sentence store?

2. How many char entries can strB store?
3. How many char entries can sentence[4] store?
4. How many double entries can aValues[MAX_A] store?
5. What is the value of aValues[2]?  [Hint:  the value is an address]
6. How many bytes are allocated to sentence?
7. What is the address associated to the last byte for sentence?
8. How many bytes of memory are allocated to aValues?
9. What is the starting address of the last double element in aValues?
#define MAX _A 50
#define MAX_B 20
typedef double arr2D [MAX_A] [MAX_B];
typedef char string[MAX_B];
typedef string arrWords [MAX_A];
void f1(double);
void f2(double []);
void f3(double [][MAX_B]);
void f4(double *);
void fa(char);
void fB(char *);
void fc (string);
void fD(
);
int
main()
{arr2D aValues; /*assume aValues is allocated space starting at
address 0030 (in decimal). */
string strA, strB; /* assume strA is allocated space at starting at
address 8050 (in decimal). */
arrWords sentence; /*
assume sentence is allocated space starting at
address 9070 (in decimal). */
//Assume all variables are initialized with values.
// to be replaced with code or function call (in the succeedin questions)
return 0;
}
Assume the following: sizeof(char) = 1, sizeof(int) = 4, sizeof(double) = 8
Answers not following the encoding instructions below will not be considered.
Encoding Instructions:
1. For questions that expect a numeric answer, place the number only. Do not use worded form. Do not put any unit. Do not use the constant identifier. Do not answer with a formula. Do not put leading zeroes.
2. If the answer is an address, the answer is supposed to be in decimal (not hex).
3. If the answer is a character, the answer is the character literal, not the ASCII value.
4. For character or string answers, do not put the quotation anymore.
5. If it is a fill-in-blank question, your answer should only indicate whatever is supposed to be placed in the blank. For example, () or ; might already be given, thus should not be included in the answer.
6. If the result will cause an error (eg. syntax or logical, like index out of bounds), the answer should be INVALID (in all capital letters)
Transcribed Image Text:#define MAX _A 50 #define MAX_B 20 typedef double arr2D [MAX_A] [MAX_B]; typedef char string[MAX_B]; typedef string arrWords [MAX_A]; void f1(double); void f2(double []); void f3(double [][MAX_B]); void f4(double *); void fa(char); void fB(char *); void fc (string); void fD( ); int main() {arr2D aValues; /*assume aValues is allocated space starting at address 0030 (in decimal). */ string strA, strB; /* assume strA is allocated space at starting at address 8050 (in decimal). */ arrWords sentence; /* assume sentence is allocated space starting at address 9070 (in decimal). */ //Assume all variables are initialized with values. // to be replaced with code or function call (in the succeedin questions) return 0; } Assume the following: sizeof(char) = 1, sizeof(int) = 4, sizeof(double) = 8 Answers not following the encoding instructions below will not be considered. Encoding Instructions: 1. For questions that expect a numeric answer, place the number only. Do not use worded form. Do not put any unit. Do not use the constant identifier. Do not answer with a formula. Do not put leading zeroes. 2. If the answer is an address, the answer is supposed to be in decimal (not hex). 3. If the answer is a character, the answer is the character literal, not the ASCII value. 4. For character or string answers, do not put the quotation anymore. 5. If it is a fill-in-blank question, your answer should only indicate whatever is supposed to be placed in the blank. For example, () or ; might already be given, thus should not be included in the answer. 6. If the result will cause an error (eg. syntax or logical, like index out of bounds), the answer should be INVALID (in all capital letters)
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