Consider that the program uses student ID for interface i.e., input and output purposes but use a student code for storing it inside computer memory. The 2 digits year in student ID is converted into 4 digits in student code. For example, if the year in student ID is 20, then it is converted to 2020 in student code. 4-byte integer variables are used for representing both the student ID and the student code. The most significant 1 bit, ie, sign bit of student code is kept unused and always contains zero. The numbers of

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

Don't reject this question.  If you are not able to provide answer kindly skip.  

(b) Upon getting admission into BUET, a student gets a student ID comprising 7 digits
The first two digits are used for representing year, the next two digits for dept code and
the last three digits for serial number as shown below:
Year
Dept Code
Serial number
6
2
0
0
5
4
5
Consider that the program uses student ID for interface i.e., input and output purposes
but use a student code for storing it inside computer memory. The 2 digits year in
student ID is converted into 4 digits in student code. For example, if the year in student
ID is 20, then it is converted to 2020 in student code. 4-byte integer variables are used
for representing both the student ID and the student code. The most significant 1 bit,
i.e., sign bit of student code is kept unused and always contains zero. The numbers of
bits used for representing Year, Dept code and Serial number in student code are 13, 9
and 9, respectively, as showing below-
Unused
Year
Dept code
9 bits
Serial number
9 bits
1 bit
13 bits
Write a C function using the following prototype to convert a student ID to a student
code.
int getStdCode (int stdID);
Transcribed Image Text:(b) Upon getting admission into BUET, a student gets a student ID comprising 7 digits The first two digits are used for representing year, the next two digits for dept code and the last three digits for serial number as shown below: Year Dept Code Serial number 6 2 0 0 5 4 5 Consider that the program uses student ID for interface i.e., input and output purposes but use a student code for storing it inside computer memory. The 2 digits year in student ID is converted into 4 digits in student code. For example, if the year in student ID is 20, then it is converted to 2020 in student code. 4-byte integer variables are used for representing both the student ID and the student code. The most significant 1 bit, i.e., sign bit of student code is kept unused and always contains zero. The numbers of bits used for representing Year, Dept code and Serial number in student code are 13, 9 and 9, respectively, as showing below- Unused Year Dept code 9 bits Serial number 9 bits 1 bit 13 bits Write a C function using the following prototype to convert a student ID to a student code. int getStdCode (int stdID);
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

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