Byte by Byte Book 8: Answer Key
Byte by Byte › Book 8: Real-World Coding, Data and AI › Answer Key Answer Key For explain-in-your-own-words questions, the key points are given; any answer covering them is correct. Chapter 1. (1) A CPU only runs machine code for its instruction set; Python must be translated first. (2) A compiler translates the whole program first and produces an executable; an interpreter translates and runs line by line and needs the source each time. (3) Halfway code between source and machine code; the Java Virtual Machine. (4) (a) syntax (b) logic (c) runtime. (5) (a) event-driven (b) declarative (c) object-oriented. (6) print("Summit") ; remove or guard the division by zero; average = (10 + 20) / 2 gives 15.0. Chapter 2. (1) let can be reassigned; const cannot. (2) "73" because + joins strings; Number("7") + 3 . (3) === checks value and type; == converts types first and causes bugs. (4) boolean, string, array ( typeof says object), object, ...