Posts

Showing posts from October, 2026

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, ...

Byte by Byte Book 8: Glossary

Byte by Byte › Book 8: Real-World Coding, Data and AI › Glossary Glossary Term Meaning Absolute reference A spreadsheet cell reference with $ signs that stays fixed when copied Acceptance criteria Conditions that show a user story is done Accuracy Share of all predictions that are correct Agile Building software in short cycles with frequent feedback Array An ordered list of values in JavaScript Assert A statement that stops a program if a condition is false Attention The transformer mechanism that weighs which words matter to each other Attribute Data stored in an object Boundary data Test values at the edges of what is allowed Branch (Git) A separate line of development Breakpoint A point where a debugger pauses a program Bytecode Intermediate code run by a virtual machine Class A blueprint for creating objects Classification ML that predicts a category Commit A saved snapshot in Git with a message Compiler Translates a whole program into machine code before it runs Confusion ...

Byte by Byte Book 8: What I Can Do Now (Skills Checklist)

Byte by Byte › Book 8: Real-World Coding, Data and AI › What I Can Do Now What I Can Do Now Tick each one you can do without looking back. ☐  Explain compilers, interpreters, bytecode and programming paradigms. ☐  Write JavaScript with variables, conditions, loops, arrays, objects and functions. ☐  Make a web page interactive using the DOM and event listeners. ☐  Write Python classes using constructors, methods and inheritance, and read simple Java. ☐  Read and write files and handle exceptions in Python. ☐  Load, clean and summarise a CSV with pandas. ☐  Calculate and interpret mean, median, mode, range, standard deviation and probability. ☐  Choose and draw honest charts with Matplotlib. ☐  Use absolute references, XLOOKUP, COUNTIFS, data validation and pivot tables in Excel. ☐  Train and test a classifier and recognise overfitting. ☐  Evaluate a model with a confusion matrix, precision and recall, and choose a threshold. ☐  Explain how LLMs work and spot their limitat...

Byte by Byte Book 8: Capstone Project – My Memunic Solution

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Capstone Project: My Memunic Solution Capstone Project: My Memunic Solution This project brings together everything in the series. You will find a real problem in your home, school or neighbourhood, and solve it the way professionals do: problem → plan → code → test → present . Plan for three to five weeks, a little each day. Example problems: the school canteen runs out of popular items; classmates forget homework deadlines; the society's water tank overflows; the library doesn't know which books are popular; a local shop wants online orders. Stage 1: Problem (Chapter 16) Interview at least three people affected. Write down their exact words. Write a one-sentence problem statement and three user stories with acceptance criteria. Decide what data you need and how you will collect it ethically (Chapter 17): consent, minimisation, no personal data you don't need. Stage 2: Plan Sketch wireframes of your web p...

Byte by Byte Book 8: Chapter 19 – Revision: Let's Remember

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 19: Revision: Let's Remember Chapter 19: Revision: Let's Remember 🔎 The Case Before the showcase, Frost sets up eight Maker Stations around Cloudhall. Every team member must clear all eight. Work through them without looking back first; then check the chapter if you get stuck. Station 1: How Code Runs (Chapter 1) Compiler or interpreter: translates the whole program before running it? What runs Java bytecode? Name the error: the program runs but prints the wrong total. Station 2: JavaScript and the DOM (Chapters 2–4) What does "3" + 4 give in JavaScript? And "3" === 3 ? Write a for loop that logs 10, 20, 30, 40, 50. Write one line that runs a function save when the button with id saveBtn is clicked. Station 3: Objects (Chapter 5) Class or object: Student ? riya = Student("Riya") ? Which OOP pillar lets a subclass reuse its parent's code? Java: which keywor...

Byte by Byte Book 8: Chapter 18 – Careers in Technology and Building Your Own Startup

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 18: Careers in Technology and Building Your Own Startup Chapter 18: Careers in Technology and Building Your Own Startup 🔎 The Case The Summit ends with a surprise: other valleys want the flood alert. Riverbend offers to pay. Kachui says, "We built it to help, not to sell." Simbha replies, "If it pays for itself, it can keep helping for years." Memoon realises the friends are facing two questions every young technologist eventually faces: what work do I want to do, and could something I built become a business? 💡 The Concepts Careers in technology. You have already met many in the Career Spotlights. A fuller map: Area Example roles What they do Software Front-end, back-end, mobile, full-stack developer Build apps and websites Data and AI Data analyst, data scientist, ML engineer, AI researcher Turn data into decisions and models Security Cybersecurity analyst, ethical hacker Protect systems...

Byte by Byte Book 8: Chapter 17 – Digital Citizenship, Cyber Law and Your Digital Footprint

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 17: Digital Citizenship, Cyber Law and Your Digital Footprint Chapter 17: Digital Citizenship, Cyber Law and Your Digital Footprint 🔎 The Case The flood-alert service will collect villagers' phone numbers and home locations. Editor Quill asks, "Who is allowed to see those? For how long? What if they leak?" At the same time, a young otter at the Summit posts an embarrassing edited photo of a classmate "as a joke", and it spreads. Two problems, one subject: how we behave online, and the laws that protect people when someone doesn't behave well. 💡 The Concepts Digital citizenship is using technology safely, respectfully and responsibly. Its parts include digital etiquette ( netiquette ), safety and security, rights and responsibilities, digital wellbeing, and digital literacy. Digital footprint. Everything you post, like, search and share leaves a record. Active footprint: what you...

Byte by Byte Book 8: Chapter 16 – The Software Development Life Cycle

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 16: The Software Development Life Cycle Chapter 16: The Software Development Life Cycle 🔎 The Case The Summit has three weeks left and five teams. One team has built a beautiful app that nobody asked for. Another argues daily because nobody wrote down what "done" means. Beautine pins a large sheet to the Cloudhall wall with six boxes and arrows between them. "Every real product, from a calculator app to a space mission, moves through these stages," she says. "Skip one and you pay for it later." 💡 The Concepts The Software Development Life Cycle (SDLC) is the series of stages for building software: Requirements (analysis): find out what users actually need. Talk to them. Write user stories in the form "As a ___, I want ___ so that ___", each with acceptance criteria (how we'll know it's done). Design: plan the solution: screens (wireframes), data, the structur...

Byte by Byte Book 8: Chapter 15 – Debugging, Testing and Version Control with Git

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 15: Debugging, Testing and Version Control with Git Chapter 15: Debugging, Testing and Version Control with Git 🔎 The Case Two days before the Summit's showcase, Glim "improves" the gauge code and everything breaks. Nobody saved the version that worked. Frost spends a night rebuilding it from memory. Afterwards she makes a rule for every team: every change is tested and every working version is saved, with a note saying what changed and why. Professionals have tools for exactly this. 💡 The Concepts Debugging is finding and fixing the cause of a bug. A systematic method: Reproduce the bug reliably. Find the exact input that causes it. Read the error message and traceback: the last line names the error, the lines above show where it happened. Isolate it: print variable values ( print("level is", level) or console.log ), or comment out parts until the bug disappears. Form a hypothe...

Byte by Byte Book 8: Chapter 14 – Using AI as a Coding Assistant Responsibly

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 14: Using AI as a Coding Assistant Responsibly Chapter 14: Using AI as a Coding Assistant Responsibly 🔎 The Case Pip, now eleven and impatient, asks a chatbot to "make a quiz app" and pastes the 200 lines it returns into the Truth Desk site. It almost works. Then it fails on the first quiz with an apostrophe in a question, and Pip has no idea why, because he never understood the code. Memoon sits down with him. "An AI can be a brilliant helper," she says. "But it can't be the one who understands. That job is yours." 💡 The Concepts What AI coding assistants do well: Explain an error message or a confusing line of code. Suggest how to approach a problem, or several approaches to compare. Write small, routine pieces (a function to format a date) that you then read and test. Review your code and point out bugs, edge cases or unclear names. Generate test cases you hadn't thought...

Byte by Byte Book 8: Chapter 13 – Generative AI and Large Language Models

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 13: Generative AI and Large Language Models Chapter 13: Generative AI and Large Language Models 🔎 The Case The Truth Desk now receives hundreds of reports a day, and Editor Quill wants an AI assistant to draft replies. Echo, the talking shell from Book 6, has been upgraded into a chatbot that writes fluent paragraphs. On its first day it confidently tells a reader that Snowpeak Hub was built in 1802 by "Sir Bramble Thorn". No such person ever existed. Vega asks the key question: "If it doesn't know, why does it sound so sure?" 💡 The Concepts Generative AI creates new content (text, images, audio, video, code) rather than only classifying. Discriminative models (Chapter 11) choose a label; generative models produce something new. Large language models (LLMs) such as ChatGPT, Gemini and Claude are neural networks trained on enormous amounts of text. Their core task is simple: predict ...

Byte by Byte Book 8: Chapter 12 – Evaluating AI: Accuracy, Precision, Recall and the Confusion Matrix

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 12: Evaluating AI: Accuracy, Precision, Recall and the Confusion Matrix Chapter 12: Evaluating AI: Accuracy, Precision, Recall and the Confusion Matrix 🔎 The Case The depth-3 model is 88% accurate. Glim wants to celebrate. Memoon asks a sharper question: "Of the nights that really flooded, how many did it miss?" The answer is 9 out of 32. Nine nights when the village would have slept while water rose. Accuracy hid that. To judge an AI you must look at which mistakes it makes, because some mistakes cost far more than others. 💡 The Concepts The confusion matrix counts four kinds of outcome for a yes/no classifier. "Positive" means the model predicts the thing we're looking for (flood). Predicted: no flood Predicted: flood Actual: no flood True Negative (TN) False Positive (FP) — false alarm Actual: flood False Negative (FN) — missed flood True Positive (TP) Metrics from it: Accuracy ...

Byte by Byte Book 8: Chapter 11 – Training and Testing a Machine Learning Model

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 11: Training and Testing a Machine Learning Model Chapter 11: Training and Testing a Machine Learning Model 🔎 The Case The warning bell rings when the river crosses the danger mark, but by then the water is already in the fields. Kachui asks the question that matters: "Can we know the night before ?" Beautine's archive holds 400 past days: rainfall today, rainfall yesterday, the morning level, and whether it flooded. In Book 7 you learned the AI project cycle and how decision trees work. Now you will build one for real, in code. 💡 The Concepts Machine learning (ML) finds patterns in example data instead of following rules a programmer wrote. In supervised learning , each example has features (inputs, called X) and a label (the right answer, called y). The model learns a mapping from X to y. Classification: the label is a category (flood / no flood, spam / not spam). Regression: the label is ...

Byte by Byte Book 8: Chapter 10 – Advanced Spreadsheets: Absolute References, Lookups and Pivot Tables

Image
Byte by Byte › Book 8: Real-World Coding, Data and AI › Chapter 10: Advanced Spreadsheets: Absolute References, Lookups and Pivot Tables Chapter 10: Advanced Spreadsheets: Absolute References, Lookups and Pivot Tables 🔎 The Case The village council's treasurer, an elderly mongoose named Grey, does not use Python. She uses Excel, as most offices in the world do. She needs to plan the cost of the new gauges and warning bells, convert prices when the coin rate changes, and summarise flood reports by village and month. Memoon realises that a programmer who cannot hand over work in a spreadsheet is only half useful. 💡 The Concepts Relative vs absolute references. In Book 5, when you copied =B2*C2 down a column, it became =B3*C3 : a relative reference that shifts. Sometimes one cell must stay fixed, such as a tax rate. Add dollar signs: Reference Copied down Copied across A1 (relative) changes row changes column $A$1 (absolute) fixed fixed $A1 (mixed) changes ro...