{"base":{"id":"cs11-15","subject":"Programming","title":"Bringing it together","scene":"mix","steps":[{"use":"code9","mode":"combo","eyebrow":"All three constructs","title":"Sequence, selection, iteration","body":"Every program combines these three.","actions":[{"id":"q1","label":"Question 1"},{"id":"q2","label":"Question 2"},{"id":"q3","label":"Question 3"},{"id":"run","label":"Run"}]},{"use":"cs11","mode":"file","eyebrow":"Files and arrays","title":"Store, load, process","body":"Load data from a file into an array, process it, save results.","actions":[{"id":"write","label":"Write"},{"id":"append","label":"Append"},{"id":"read","label":"Read a line"}]},{"use":"cs10t3","mode":"sql","eyebrow":"Databases","title":"Ask the data","body":"Use SQL to answer questions about stored data.","actions":[{"id":"q0","label":"Query 1"},{"id":"q2","label":"Query 2"},{"id":"q3","label":"Query 3"}]},{"use":"cs10t3","mode":"gates","eyebrow":"Hardware logic","title":"Gates underneath it all","body":"At the lowest level, everything is logic gates.","controls":[{"id":"g","label":"Gate (0 NOT · 1 AND · 2 OR)","min":0,"max":2,"step":1,"value":1,"hideValue":true}],"actions":[{"id":"a","label":"Toggle A"},{"id":"b","label":"Toggle B"}]},{"use":"code9","mode":"quiz","look":"combo","eyebrow":"Check yourself","title":"Constructs","body":"A loop that keeps asking for a password until it is correct uses…","question":"Choose the best answer.","options":["Sequence only","Iteration and selection","Selection only"],"answer":1,"right":"Correct.","wrong":"Not quite."}],"more":[{"type":"cards","id":"worked","eyebrow":"Worked examples","title":"Step by step","items":[{"tag":"Project","title":"Quiz app","body":"load questions from file → loop through → check answers (selection) → total score → save to file","code":true},{"tag":"Subroutines","title":"Structure","body":"LoadQuestions() · AskQuestion(q) · SaveScore(name, score)","code":true},{"tag":"Validation","title":"Input","body":"REPEAT INPUT answer UNTIL answer IN [\"A\", \"B\", \"C\"]","code":true},{"tag":"Testing","title":"Plan","body":"normal answers, invalid letters, empty file","code":true}]},{"type":"cards","id":"mistakes","eyebrow":"Common mistakes","title":"Watch out for these","items":[{"tag":"Mistake","title":"One giant block of code","body":"Use subroutines for each task."},{"tag":"Mistake","title":"No validation","body":"Real users enter unexpected data."},{"tag":"Mistake","title":"No comments or meaningful names","body":"Future you will thank you for clear names."}]},{"type":"cards","id":"method","eyebrow":"Set out your answer","title":"Full development","items":[{"tag":"1","title":"Analyse","body":"Requirements."},{"tag":"2","title":"Design","body":"Structure chart and pseudocode."},{"tag":"3","title":"Develop","body":"Subroutines, arrays, files."},{"tag":"4","title":"Test and evaluate","body":"Test plan; compare with requirements."}]},{"type":"cards","id":"deeper","eyebrow":"Go deeper","title":"More than the lesson","items":[{"tag":"Careers","title":"Where next?","body":"These skills lead to software engineering, data science, cyber security, game design and more."},{"tag":"Further study","title":"Next steps","body":"A-level or equivalent courses add object-oriented programming, recursion and complex data structures."}]},{"type":"cards","id":"challenge","eyebrow":"Challenge yourself","title":"Stretch your brain","intro":"Try each one on paper before opening the card.","items":[{"tag":"Challenge","title":"Design","body":"Design a library system with files for books and loans. List subroutines.\n\nAnswer: e.g. LoadBooks, SearchBook, LendBook, ReturnBook, SaveAll."},{"tag":"Challenge","title":"Explain","body":"How do logic gates relate to a Python IF statement?\n\nAnswer: the condition is evaluated by circuits of logic gates in the CPU."}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Try it yourself","items":[{"title":"Capstone project","time":"2 hours over a week","need":["Python"],"steps":["Choose a project: quiz, tracker or game.","Write requirements and a design.","Build with subroutines, arrays, files and validation; test and evaluate."],"why":"You bring the whole course together.","safety":"None."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Eight more questions","questions":[{"question":"The three programming constructs are…","options":["input, output, storage","arrays, files, SQL","sequence, selection, iteration"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Subroutines make programs…","options":["easier to read and test","slower","longer"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"Data that must survive closing the program goes in…","options":["a local variable","a file","RAM only"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"SQL is used to…","options":["draw graphics","compile code","query databases"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Validation checks…","options":["input is sensible","code compiles","files exist"],"answer":0,"right":"Correct.","wrong":"Not quite."},{"question":"At the hardware level, decisions use…","options":["paper","logic gates","sound waves"],"answer":1,"right":"Correct.","wrong":"Not quite."},{"question":"A test plan should include…","options":["only normal data","no expected results","normal, boundary and erroneous data"],"answer":2,"right":"Correct.","wrong":"Not quite."},{"question":"Meaningful variable names…","options":["make code easier to understand","slow programs down","are not allowed"],"answer":0,"right":"Correct.","wrong":"Not quite."}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can…","items":["combine sequence, selection and iteration","use subroutines, arrays and files in one program","use SQL to query data","link software to hardware logic","plan, build, test and evaluate a complete solution"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"Sequence","meaning":"Instructions in order."},{"word":"Selection","meaning":"Choosing a path with IF/CASE."},{"word":"Iteration","meaning":"Repeating with loops."},{"word":"Modular","meaning":"Built from subroutines."},{"word":"Evaluation","meaning":"Judging a solution against requirements."}]},{"type":"sources","id":"sources","title":"Sources","items":["Python documentation: tutorial","Raspberry Pi Foundation: projects","Raspberry Pi Foundation, Isaac Computer Science","BBC Bitesize, GCSE Computer Science"]}]},"overlay":null}