View ECS401U Procedural Programming - 2026A complete, structured learning path for Procedural Programming, built considering the module’s lectures, labs, revision material and exam questions. The Space develops the knowledge and practical skills needed across the full module, including tracing code, predicting program behaviour, finding errors and writing clear solutions. Follow the path from the foundations or jump directly to the lessons you need, with each Session grounded in the relevant course material and exam-style tasks. You will end by doing a full exam paper.
- Subject
- Procedural Programming
- Lessons
- 17
- Materials
- 19
Materials
- endterm2025.pdf
- ECS401slides4-if-for.pdf
- style-guide_merged.pdf
- ECS401slides6-accessor-while.pdf
- ECS401slidesWK11-12-sorting2025.pdf
- ECS401slides1-2025.pdf
- ECS401slides3-if.pdf
- 2026ppe1.pdf
- dry-run-guide.pdf
- Markscheme-guidance.txt
- guidance.txt
- ECS401slides5-array.pdf
- endtermanswers.pdf
- ECS401slides2-assign.pdf
- ECS401slides9-References.pdf
- ECS401slides7-feedback.pdf
- ECS401slidesWK10-RecursionDC2025.pdf
- ECS401slides8-ADT.pdf
- ECS401slidesWK11-file2025.pdf
Learning path
- Orient Yourself and Build a Route — A broad diagnostic maps the whole module and helps you enter the full route at the capabilities you actually need. Main objective: You will sample the major programming, tracing, explanation, data-structure, algorithm, and file-processing capabilities, identify precise gaps, and choose a prerequisite-aware route through the module.. Objectives: You will map the module into procedural structure, values and types, decisions, repetition, arrays and records, searching, ADTs, references, exact tracing, recursion, sorting, file processing, explanations, and full-program construction.; You will produce a short cold sample of an explanation, a dry-run table, a method-based program plan, and one algorithm or data-structure task without opening model answers.; You will classify each capability as secure, usable with checking, or needing repair and name the exact failure rather than writing a vague topic label.; You will be recommended the earliest lesson that repairs each gap while being allowed to skip capabilities you can already demonstrate independently.; You will begin a compact note set containing reusable method patterns, dry-run rules, comparison structures, and personal error traps, adding to it only after active attempts.. Materials: ECS401slides1-2025.pdf; 2026ppe1.pdf; Markscheme-guidance.txt; guidance.txt.
- Build Procedural Programs from Methods — You will turn a small task into a complete Java procedural program made from focused, communicating methods. Main objective: You will construct a valid procedural-program skeleton and decompose a specification into small methods using local variables, arguments, returns, and clear input–process–output responsibilities.. Objectives: You will explain a program as a collection of named methods and identify calls, procedures, functions, classes, and the starting role of main.; You will write a complete class containing main and additional method definitions, with record-only classes kept separate when needed.; You will declare variables inside the smallest suitable method or block and never rely on global state.; You will choose a function when a result must be returned and a procedure when the method only performs an action.; You will pass information into methods through arguments and pass results back through return values.; You will split a task into input, processing, and output methods whose names reveal the program’s high-level algorithm.; You will use meaningful names, method comments, consistent indentation, and one clear task per method so the code can be understood and tested locally.. Materials: ECS401slides1-2025.pdf; style-guide_merged.pdf; ECS401slides2-assign.pdf; ECS401slides4-if-for.pdf.
- Manipulate Values, Types, and Input — You will use variables, expressions, assignment, keyboard input, output, and type conversion without semantic mistakes. Main objective: You will write and explain straight-line Java code that stores typed values, evaluates expressions, reads input with nextLine, converts it safely, updates variables by assignment, and prints exact results.. Objectives: You will explain a variable as named typed storage and distinguish the variable, the value currently stored, and the method in which it exists.; You will declare and initialise int, double, boolean, char, and String variables and explain how types constrain values and operations.; You will read assignment as copying the right-hand value into the left-hand variable and distinguish it from equality.; You will predict arithmetic and String-concatenation expressions in the correct evaluation order and avoid confusing numbers with numeric text.; You will create a Scanner, read complete lines with nextLine, and package repeated input behaviour into methods.; You will convert numeric text using Integer.parseInt before performing calculations and explain why the conversion is necessary.; You will dry run straight-line assignments one executed line at a time and state the exact printed output.. Materials: ECS401slides2-assign.pdf; ECS401slides3-if.pdf.
- Make Decisions with Boolean Logic — You will construct, trace, and explain defensive if/else decision logic using correct comparisons and complete branches. Main objective: You will write and dry run decision-making code that forms correct boolean expressions, distinguishes assignment from comparison, handles every valid and invalid case, and explains exactly which branch executes and why.. Objectives: You will treat boolean as a typed value and build true-or-false expressions from relational operators.; You will use == for primitive values, .equals for Strings, and never use assignment as a test.; You will combine tests with &&, ||, and ! while accounting for short-circuit evaluation and operator meaning.; You will write if, else-if, and final else branches that cover the intended cases without overlap or omissions.; You will use decisions inside a repetition structure to reject invalid input and give a useful retry message.; You will trace each test with current values, execute only the selected branch, and omit non-executed lines.. Materials: ECS401slides3-if.pdf; ECS401slides4-if-for.pdf; style-guide_merged.pdf.
- Repeat Fixed Work with For Loops — You will design, trace, and debug counter-controlled and nested loops for fixed, countable repetition. Main objective: You will write for loops with correct initialisation, condition, update, bounds, accumulators, and nested structure, then prove their behaviour through exact dry runs and boundary tests.. Objectives: You will identify the counter’s start value, continuation test, update, and body, and state the exact values it takes.; You will choose < or <= and the correct initial value so the body executes exactly the required number of times.; You will initialise and update totals, counts, products, or constructed Strings exactly once per required iteration.; You will first make the one-iteration body correct, then place the loop around it instead of trying to debug both at once.; You will show every repeated condition test, including the final false test that exits the loop.; You will use rectangular and triangular nested loops when a task processes pairs, tables, or shrinking ranges.. Materials: ECS401slides4-if-for.pdf; ECS401slides5-array.pdf.
- Store and Process Bulk Data with Arrays — You will create, fill, traverse, summarise, and safely index fixed-size arrays using focused methods. Main objective: You will design array-processing code that distinguishes indexes from values, respects fixed bounds and partial occupancy, uses loops for bulk work, and decomposes input, output, searching, and aggregation into reusable methods.. Objectives: You will explain an array as fixed-length, same-type bulk storage indexed by integers from zero.; You will declare an array variable, allocate the required length, and use length without attempting the nonexistent index at that length.; You will state separately the index being accessed and the value stored there, preventing off-by-one and value-as-position errors.; You will initialise or transform every element with a for loop whose counter is the array index.; You will keep a separate count of meaningful entries when an allocated array is not yet full and stop processing at that count.; You will split array input, printing, totals, averages, and other transformations into small methods with array and size arguments.; You will choose arrays for uniform bulk data and records for a named mixture of fields, including arrays of records when both are needed.. Materials: ECS401slides5-array.pdf; ECS401slides6-accessor-while.pdf.
- Model Entities with Records and Accessors — You will define compound record types and control their creation and field access through focused methods. Main objective: You will model a real entity as a record, create valid record values, store them in arrays when needed, and write creation, getter, setter, and search methods that isolate field access from the rest of the program.. Objectives: You will define a record class whose named fields have types that match the entity being represented.; You will allocate records with new and initialise every required field before use.; You will use a creation method so records cannot be accidentally left uninitialised or inconsistently constructed.; You will write one getter and setter for each field and use dot notation only inside these record operations.; You will store records in an array and search one identifying field to recover the position of the complete record.; You will keep record classes field-only and place every method in the single procedural program class.. Materials: ECS401slides3-if.pdf; ECS401slides6-accessor-while.pdf; style-guide_merged.pdf.
- Search and Repeat with While Loops — You will implement linear-search variants and choose while loops for repetition whose length is decided as the program runs. Main objective: You will write and explain linear searches, sentinel and input-validation loops, and for-versus-while choices, while preventing non-termination and preserving clear loop invariants.. Objectives: You will scan an unordered array from the first element, return the first matching index, and return -1 only after every valid element has been checked.; You will adapt the element type, equality test, stopping rule, and returned result for first, last, all, count, or record-field searches.; You will initialise the controlling state before the loop, test it at the top, and update it on every path through the body.; You will keep asking until a value satisfies the required range or allowed-option condition, returning only valid data.; You will process an unknown sequence until a sentinel appears while maintaining totals, counts, or stored results.; You will explain that every counter-controlled for loop can be expressed as a while loop, while genuinely input-controlled repetition is not a pure counter-controlled loop.; You will reject while(true) as the normal design, identify missing updates or unreachable exit conditions, and localise failures with targeted tracing.. Materials: ECS401slides6-accessor-while.pdf; style-guide_merged.pdf.
- Design and Use Abstract Data Types — You will turn records into behavioural data abstractions whose representation is hidden behind meaningful operations. Main objective: You will specify an ADT by its visible values and operations, implement it with a record and methods, preserve its invariants, and demonstrate that client code remains unchanged when the internal representation changes.. Objectives: You will describe what users can observe and do without exposing the record fields or implementation algorithm.; You will choose the smallest complete family of create, query, and update operations required by the client program.; You will include meaningful operations that enforce behaviour or invariants rather than presenting getters and setters as the whole ADT.; You will implement creation, insertion, removal, query, and empty/full checks without allowing invalid state.; You will explain how two different record representations can implement the same operations while the client program remains unchanged.; You will design operations such as set insertion so the representation can never contain a forbidden duplicate or invalid state.; You will compare records and ADTs integratively: both create compound types, but only the ADT defines and protects a behavioural interface.. Materials: ECS401slides8-ADT.pdf; 2026ppe1.pdf.
- Reason about References, Stack, and Heap — You will explain and trace how primitive and reference values are stored, assigned, compared, and passed to methods. Main objective: You will draw and explain stack–heap state for arrays, records, and Strings, predict aliasing and null behaviour, and use method calls to show exactly when copying a reference makes mutations visible to the caller.. Objectives: You will show that primitive assignment copies the value into an independent variable, while array or record assignment copies a reference that can alias the same heap object.; You will draw a stack variable holding a reference arrow to array or record data on the heap and update the correct location for variable versus element assignment.; You will explain why == checks reference identity for arrays, records, and Strings, while .equals is needed for String content.; You will place local variables and parameters on the stack, actual arrays and records on the heap, and references in the variables that point to them.; You will distinguish null from an empty String or zero-length array and predict the error caused by following a null reference.; You will show that a method receives a copied reference, so element or field mutations are visible through the caller’s original reference after return.; You will use the current seti method to explain valid indexing, visible mutation, boolean return values, and what would happen for a null array.. Materials: 2026ppe1.pdf; ECS401slides9-References.pdf.
- Dry Run Procedural Code Exactly — You will trace mixed Java code in the required ECS401 table style and reproduce its output exactly. Main objective: You will construct complete dry-run tables for assignments, decisions, loops, arrays, records, methods, references, and recursion, recording only executed lines and carrying state and return values across calls without approximation.. Objectives: You will give every executed line one row, omit unexecuted lines, and update only the state changed by that execution.; You will give each decision or loop test a column containing current values, a question mark, and the resulting true or false value.; You will repeat line numbers for every iteration, include the final false test, and represent each array index as its own sub-column.; You will create a separately titled table for each method call, show actual argument values, pause the caller, and carry the returned result back to the calling row.; You will represent record fields as sub-columns and use explicit address labels or stack–heap diagrams when aliasing is central to the question.; You will open a new table for every recursive call and resume suspended callers only after the base-case result returns.; You will place the final output in a separate box containing exactly the printed characters, spaces, and line breaks and no explanatory text.; You will audit for missing call tables, copied array rows, omitted final tests, skipped branches, and output that is semantically right but not character-exact.. Materials: 2026ppe1.pdf; dry-run-guide.pdf; ECS401slidesWK10-RecursionDC2025.pdf; ECS401slides7-feedback.pdf.
- Solve with Recursion and Binary Search — You will design terminating recursive methods and use divide and conquer to search sorted arrays efficiently. Main objective: You will express recursive problems with a base case and smaller step case, trace the call stack, implement binary search over a sorted range, and compare its work with linear search.. Objectives: You will repeatedly split a problem into a smaller instance of the same form and combine or return the smaller solution.; You will use the middle element as a signpost, discard the impossible half, and continue only within the remaining sorted range.; You will state a non-recursive base case and a recursive case whose argument is smaller in a measure that must eventually reach the base.; You will translate a mathematical recurrence into Java for tasks such as a sum, product, or range calculation.; You will prove that each recursive path reaches the base case and identify missing or unreachable get-out clauses.; You will trace the descent and return phases separately, showing each call’s parameters, suspended expression, and returned value.; You will compare prerequisites, discarded work, worst-case checks, and the sort-versus-search trade-off for linear and binary search.. Materials: ECS401slidesWK10-RecursionDC2025.pdf.
- Sort Arrays and Compare Algorithms — You will implement bubble sort and reason about divide-and-conquer sorts, invariants, and efficiency. Main objective: You will trace and write in-place bubble-sort variants, explain merge sort and quicksort as recursive divide-and-conquer strategies, and compare their assumptions, data movement, and growth in work.. Objectives: You will state the required order, whether the original array may be changed, and which data properties affect the algorithm choice.; You will swap adjacent out-of-order values and make enough shrinking passes to place each largest remaining value in its final position.; You will explain why a void swap method changes the caller’s array even though the reference itself is passed by value.; You will maintain a sorted flag correctly so the algorithm stops only after a complete pass makes no swaps.; You will split the array, recursively sort both halves, and merge two already-sorted sequences by repeatedly selecting the smaller front value.; You will explain pivot partitioning, recursive subarray sorting, and the data-order case in which quicksort performs badly.; You will compare the quadratic comparison growth of bubble sort with the layered n log n pattern of merge sort.. Materials: ECS401slidesWK11-12-sorting2025.pdf.
- Read, Write, and Copy Files — You will use persistent storage by opening, processing, and closing text-file streams safely. Main objective: You will write procedural methods that create output streams, read input streams line by line, detect end of file with null, copy unknown-length files, close every stream, and explain how persistent storage differs from screen and keyboard I/O.. Objectives: You will explain that file data survives the running program and can be reopened after the computer or process stops.; You will create a PrintWriter over a FileWriter, send lines to it, and close the output stream after the final write.; You will create a BufferedReader over a FileReader, read known lines with readLine, process them, and close the input stream.; You will read the first line before the loop, continue while the line is not null, and read the next line at the end of each iteration.; You will combine an input stream and output stream to copy every line while preserving order and closing both resources.; You will isolate opening, reading, transforming, writing, and closing responsibilities and test empty, one-line, multi-line, and missing-data cases.. Materials: ECS401slidesWK11-file2025.pdf.
- Write High-Mark Explanations and Comparisons — You will turn genuine conceptual understanding into clear, integrative, example-driven exam answers. Main objective: You will write explanation and compare-and-contrast answers in your own words, use required examples purposefully, move between terminology and concrete execution, and self-mark for depth, synthesis, completeness, and clarity.. Objectives: You will explain a concept so a novice could reconstruct its meaning rather than repeat a memorised definition.; You will move from correct technical language to a concrete example or everyday explanation and then explicitly link the example back to the concept.; You will organise comparisons as several explicit similarity and difference points, treating both concepts together in every developed paragraph.; You will select lines or behaviours from the question’s supplied code and explain how each one illustrates the point being made.; You will choose relevant points about structure, execution semantics, intended use, defensive programming, limitations, common errors, storage, and efficiency rather than listing surface syntax.; You will compare your answer with model answers and marking guidance, identify missing or weakly explained points, and rewrite from memory in a clearer structure.; You will complete the current references explanation, records-versus-ADTs comparison, and a for-versus-while comparison under their word limits.. Materials: ECS401slides7-feedback.pdf; Markscheme-guidance.txt; 2026ppe1.pdf; style-guide_merged.pdf; guidance.txt; endtermanswers.pdf; endterm2025.pdf.
- Design, Write, and Test Full Programs — You will convert a substantial specification into a complete, high-mark procedural Java program under assessment conditions. Main objective: You will analyse a full-program specification, design records and ADTs, decompose the algorithm into methods, implement loops, decisions, arrays, search, and validation, then test boundary cases and repair the first incorrect method without copying model code.. Objectives: You will translate prose into data, commands, validation rules, loop termination, update conditions, and boundary cases before writing code.; You will produce a method list in which each method performs one clear task and main reads as the high-level algorithm.; You will choose records for compound entities, arrays for bounded collections, and meaningful ADT operations that protect the program’s invariants.; You will write a top-tested command or game loop and complete if/else structures whose conditions directly express the specification.; You will read with nextLine, convert explicitly, and reprompt until commands, ranges, and options meet the specification.; You will keep methods in one class, record classes field-only, variables local, names meaningful, literals named with final, and method purpose comments concise.; You will dry test ordinary flows, invalid inputs, empty and full data, failed searches, overshoots, exact finishes, repeated commands, and termination.; You will compare only after completing the attempt, assign each failure to a precise requirement or method, and rewrite that method without viewing the correction.. Materials: 2026ppe1.pdf; endterm2025.pdf; style-guide_merged.pdf; ECS401slides7-feedback.pdf.
- Run Mixed Readiness Checks and Repair — You will complete authentic timed work, mark it to the module standard, and independently reconstruct every weak answer. Main objective: You will choose an authentic full or sectional paper, work without tutor assistance, mark explanations, dry runs, algorithms, and code against the supplied standards, then redo each failed part from a blank page and update a final risk-focused revision plan.. Objectives: You will be recommended the current full paper, the shorter end-term paper, or selected unseen sections according to remaining time and prior exposure, while retaining the final choice.; You will open only the question material, set the official timer, and work independently without hints, intermediate checking, or model answers.; You will assign every lost mark to a missing concept, weak comparison, incorrect dry-run row, output character, unmet requirement, logic branch, style rule, or untested boundary.; You will rewrite weak explanations in your own words with several developed points and purposeful use of the supplied example.; You will rebuild every incorrect table and final output from fresh code reading without looking at the correction during the redo.; You will rewrite failed methods or control-flow sections directly from the specification and rerun the exact boundary case that exposed each error.; You will update the two double-sided note pages with only reusable structures and personal traps, then either repeat a focused lesson or complete one fresh transfer task for each remaining weakness.. Materials: 2026ppe1.pdf; endterm2025.pdf; guidance.txt; Markscheme-guidance.txt; endtermanswers.pdf; dry-run-guide.pdf.