Pseudocode SolutionsPseudocode Solutions

🧑‍🚀

A Human Message

Week 4, 2026

All Solutions

Pseudocode A Human Message | MarsKing | Pseudocode Solutions

FUNCTION BINARYTOTEXT(binary:STRING) RETURNS STRING DECLARE Result:INTEGER DECLARE ReturnString:STRING ReturnString ← "" FOR Count ← 1 TO LENGTH(binary) STEP 8 Result ← 0 FOR I ← 7 TO 0 STEP -1 IF MID(binary,(Count+7-I),1) = "1" THEN Result ← Result + (2^I) ENDIF NEXT I ReturnString ← ReturnString & CHR(Result) NEXT Count RETURN ReturnString ENDFUNCTION

Pseudocode | program52 | Pseudocode Solutions

DECLARE binaryStr, message : STRING DECLARE index : INTEGER binaryStr ← "00100010010010000110010101101100011011000110111100100000011001100111001001101111011011010010000001110100011010000110010100100000011000110110100001101001011011000110010001110010011001010110111000100000011011110110011000100000011100000110110001100001011011100110010101110100001000000100010101100001011100100111010001101000001011100010001000100000001011010010000001010110011011110111100101100001011001110110010101110010001000000011000100100000001001100010000000110010001011000010000000110001001110010011011100110111" FOR index ← 1 TO LENGTH(binaryStr) STEP 8 message ← message & byteToChar(MID(binaryStr, index, 8)) NEXT index OUTPUT message FUNCTION byteToChar(byte : STRING) RETURNS CHAR DECLARE posVal, sum, stringIndex : INTEGER posVal ← 128 sum ← 0 stringIndex ← 1 WHILE posVal >= 1 DO IF MID(byte, stringIndex, 1) = "1" THEN sum ← sum + posVal ENDIF posVal ← posVal DIV 2 stringIndex ← stringIndex + 1 ENDWHILE RETURN CHR(sum) ENDFUNCTION