Signed up recently but had issues with the confirmation email?
Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.
Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.
The use of basic string manipulation: ASCII Conversion
2.2.3 Additional Programming Techniques
Practise exam questionsAdditional Programming Techniques — Note 13 of 13
ASCII conversion means changing a character into its character code, or a code back into its character. In OCR Exam Reference Language, ASC() takes a character and returns its ASCII code, and CHR() takes a code and returns the character. Because the codes for letters are in order, you can do arithmetic on them, for example to move a letter along the alphabet or change its case.
ASC(character) returns a NUMBER: ASC("A") gives 65.CHR(code) returns a CHARACTER: CHR(97) gives "a".CHR(ASC("g") + 1) gives "h".ASC("Z")), subtract 26 so it wraps back round to the start of the alphabet..substring(i, 1), convert each character, and join the results onto a new string with +.ASC() is ord() and CHR() is chr(): ord("A") gives 65 and chr(97) gives 'a'.print(ASC("A")) // 65
print(CHR(97)) // a
// Codes are in order: add 1 for the next letter
letter = "g"
print(CHR(ASC(letter) + 1)) // h
// Change a lower-case word to upper case, one character at a time
word = "lemon"
upperWord = ""
for i = 0 to word.length - 1
code = ASC(word.substring(i, 1))
upperWord = upperWord + CHR(code - 32)
next i
print(upperWord) // LEMONprint(ord("A")) # 65
print(chr(97)) # a
# Codes are in order: add 1 for the next letter
letter = "g"
print(chr(ord(letter) + 1)) # h
# Change a lower-case word to upper case, one character at a time
word = "lemon"
upper_word = ""
for i in range(len(word)):
code = ord(word[i])
upper_word = upper_word + chr(code - 32)
print(upper_word) # LEMONChanging a character into its numeric ASCII code, or changing a code back into the character it represents.
The number a character set such as ASCII uses to represent a character. 'A' is 65 and 'a' is 97.
.length - 1 and use the loop counter as the start position in .substring(counter, 1). Examiners found the substring position and the number added to each code were most often wrong.ASC turns a character into a NUMBER; CHR turns a number into a CHARACTER. To join the result of ASC onto a string, cast it with str() first.letter to upper case: upper = CHR(ASC(letter) - 32). With letter = "g": ASC("g") is 103, 103 − 32 = 71, and CHR(71) is "G".Ready to test yourself?
Practise 2.2.3 questions