0
0
Intro to Computingfundamentals~20 mins

How text is stored (ASCII, Unicode) in Intro to Computing - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Text Encoding Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding ASCII and Unicode

Which statement best explains the difference between ASCII and Unicode?

AASCII and Unicode are exactly the same in how they store text.
BASCII uses 7 bits per character and supports 128 characters, while Unicode uses multiple bytes to support over a million characters.
CUnicode is an older system that uses fewer bits than ASCII.
DASCII supports all languages worldwide, but Unicode only supports English characters.
Attempts:
2 left
💡 Hint

Think about how many characters each system can represent.

trace
intermediate
1:30remaining
Trace the Unicode encoding of a character

Given the character 'A', what is its Unicode code point and ASCII value?

AUnicode: U+0041, ASCII: 65
BUnicode: U+0061, ASCII: 97
CUnicode: U+0041, ASCII: 97
DUnicode: U+0061, ASCII: 65
Attempts:
2 left
💡 Hint

Remember 'A' uppercase has a different code than 'a' lowercase.

Comparison
advanced
2:00remaining
Comparing storage sizes of ASCII and Unicode

Which option correctly compares the storage size needed for the word 'Hello' in ASCII and Unicode UTF-8 encoding?

A'Hello' uses 5 bytes in ASCII and 10 bytes in UTF-8 Unicode.
B'Hello' uses 10 bytes in ASCII and 5 bytes in UTF-8 Unicode.
C'Hello' uses 5 bytes in ASCII and 15 bytes in UTF-8 Unicode.
D'Hello' uses 5 bytes in ASCII and 5 bytes in UTF-8 Unicode.
Attempts:
2 left
💡 Hint

Consider that ASCII characters are encoded the same way in UTF-8.

identification
advanced
1:30remaining
Identify the error in Unicode representation

Which option shows an incorrect Unicode escape sequence for the character '€' (Euro sign)?

A'\u20AC'
B'\u0024'
C'\u20AG'
D'\u20ac'
Attempts:
2 left
💡 Hint

Unicode escape sequences use hexadecimal digits 0-9 and A-F only.

🚀 Application
expert
2:00remaining
Determine the number of characters stored

A text file contains the string '你好' (two Chinese characters). How many bytes does it take to store this string in UTF-8 encoding?

A6 bytes
B4 bytes
C2 bytes
D8 bytes
Attempts:
2 left
💡 Hint

Each Chinese character typically uses 3 bytes in UTF-8.