B. hand gestures
these are not verbal.
Answer:
In python Language:
cardNotation = raw_input("Enter card notation: ")
# Create a dict for values
cardColors = {"D": "Diamonds",
"H": "Hearts",
"S": "Spades",
"C": "Clubs"}
cardNumberValues = {"A": "Ace",
"J": "Jack",
"Q": "Queen",
"K": "King",
"2": "Two",
"3": "Three",
"4": "Four",
"5": "Five",
"6": "Six",
"7": "Seven",
"8": "Eight",
"9": "Nine",
"10": "Ten"}
# Handle cases when 10 comes in input
if len(cardNotation) == 3:
number = cardNotation[:2]
color = cardNotation[2:]
print cardNumberValues.get(number) + " of " + cardColors.get(color)
elif len(cardNotation) == 2:
number = cardNotation[:1]
color = cardNotation[1:]
print cardNumberValues.get(number) + " of " + cardColors.get(color)
else:
print "INVALID VALUE"
Answer:
3e : 00111110 (62)
3e0 : 0000001111100000 (992)
3e00 : 0011111000000000 (15872)
Explanation:
Converting the given hexadecimal numbers to binary and decimal format:
1) 3e
3-> 0011
e-> 1110
Combining , 3e -> 00111110
This can be converted to decimal by multiplying each 1 in the binary representation by 2^(position -1) and adding the results.
So 3e = 32+16+8+4+2 = 62
2) 3e0
Binary => 0000001111100000
Converting to decimal : 992 [ This is 16 times a]
3) 3e00
Binary => 0011111000000000
Converting to decimal : 15872 [ This is 16 times b]
So adding a 0 to the hex representation multiplies the decimal number by 16.