In-Class Practice

Data Types


Character Representation

What are the decimal and hexadecimal ASCII encodings for the following characters

 '0'  ___________________________________________

 'a'  ___________________________________________

 'A'  ___________________________________________

What are the decimal and hexadecimal EBCDIC encodings for the following characters

 '0'  ___________________________________________

 'a'  ___________________________________________

 'A'  ___________________________________________

Convert the following binary values to ASCII characters:

 0110 1101 ______________________________________

 0100 1101 ______________________________________

Convert the following decimal values to EBCDIC characters:

 199 ____________________________________________

 135 ____________________________________________


Declarations

Which of the following is not a valid identifier?

 whale  giraffe's  camel_back  4me2  _how_do_you_do

 senecac.on.ca digt3 register 

Select a descriptive identifier for the variable that holds the following information and write a complete declaration for that variable:

 Books on loan            ________________________________

 Cash in a cash register  ________________________________

 A student number    _____________________________________

 Humidity            _____________________________________


Two's Complement

Assume a 2-byte word.  What is the two's complement binary value for

 -63  ___________________________________________

 -27  ___________________________________________

Assume a 2-byte word.  Convert the following binary values to decimal:

 1111 1111 1111 0101 ____________________________

 1111 1111 1011 1011 ____________________________




   Printer Friendly Version of this Page print this page     Top  Go Back to the Top of this Page



  Designed by Chris Szalwinski   Copying From This Site   

Creative Commons License