CS 7643 QUIZ 1 COMPREHENSIVE EXAM SCRIPT COMPLETE QUESTIONS VERIFIED
SOLUTIONS
Question:
In Java, C or C++ code, when a number begins with a leading 0x, what do you know about that
number: (example: int zzz =0x12;)
Answer:
Hexadecimal
Question:
In Java, C or C++ code, when a number begins without a prefix, what do you know about that
number: (example: int zzz =12;)
Answer:
Decimal
Question:
How many binary digits are needed to represent one hexadecimal digit?
Answer:
4
Question:
In C, in your writeline function, you have a loop of printing characters terminating when processing
what character:
Answer:
\0
, Question:
Should you print a NULL character in writeline?
Answer:
No
Question:
Write the hexadecimal value that represents all 1s for 64 bits
Answer:
0xFFFFFFFFFFFFFFFF
Question:
Assuming a 4 bit unsigned word, convert the binary number 0101 to hexadecimal:
Answer:
0x5
Question:
Assuming a 4 bit unsigned word, convert the binary number 1000 to hexadecimal:
Answer:
0x8
Question:
Assuming a 4 bit unsigned word, convert the binary number 1111 to hexadecimal:
Answer:
0xF
Question:
SOLUTIONS
Question:
In Java, C or C++ code, when a number begins with a leading 0x, what do you know about that
number: (example: int zzz =0x12;)
Answer:
Hexadecimal
Question:
In Java, C or C++ code, when a number begins without a prefix, what do you know about that
number: (example: int zzz =12;)
Answer:
Decimal
Question:
How many binary digits are needed to represent one hexadecimal digit?
Answer:
4
Question:
In C, in your writeline function, you have a loop of printing characters terminating when processing
what character:
Answer:
\0
, Question:
Should you print a NULL character in writeline?
Answer:
No
Question:
Write the hexadecimal value that represents all 1s for 64 bits
Answer:
0xFFFFFFFFFFFFFFFF
Question:
Assuming a 4 bit unsigned word, convert the binary number 0101 to hexadecimal:
Answer:
0x5
Question:
Assuming a 4 bit unsigned word, convert the binary number 1000 to hexadecimal:
Answer:
0x8
Question:
Assuming a 4 bit unsigned word, convert the binary number 1111 to hexadecimal:
Answer:
0xF
Question: