Ready to begin
Choose Next step to follow the actual course records.


A record is one card with named fields: Name, DateOfBirth, marks and so on. A list is an ordered collection of values or records. Integer values are whole numbers, including negative numbers and zero; a character is one symbol; a string is a sequence of characters; a Boolean is true or false. A subtype restricts values or operations, such as integer marks from 0 to 100 or valid calendar dates.
Check data sanity before using it: fields must exist, marks must be in range, totals must agree with their component marks, and dates must be valid. The course’s Gender field has the labels M and F; that is the supplied dataset’s coding, not a complete description of people. Respect the field’s permitted operations. Dates and city labels should not be treated as ordinary numbers merely because they have a written representation.
An assignment gives a variable a value. Sum = Sum + X.Mathematics means read the old Sum, add this mark, then store the result; it is not an algebraic equality. A count usually starts at 0; a sum starts at 0; a maximum can start with the first valid record or an explicit empty state. Handle empty inputs rather than assuming a first card exists.
A flowchart uses rounded terminals for start/end, rectangles for processes and diamonds for decisions, linked by arrows. A loop has a continuation test and a route back after processing. In pseudocode, WHILE is the repetition and IF selects updates. Move the current card or advance an index so the loop makes progress. Every path must eventually reach a stop condition.
| Question | Pattern | Dataset example |
|---|---|---|
| How many? What total? | One scan with count/sum accumulators | 30 score cards; Mathematics sum 2171 |
| Which records meet a fixed rule? | Filter during the scan | CityTown is Chennai |
| What is the maximum? | Compare with an updating variable | Mathematics maximum 97 |
| Who is below the final mean? | Accumulate first, classify in a second pass | 15 students below 2171/30 |
| Same operation for different fields? | A procedure with a field parameter | MaxMarks for Maths, Physics, Chemistry, Total |
| Which two records relate? | Pair search, often nested iteration | Same day and month of birth |
| Can groups rule out work? | Bin, then inspect relevant groups | City bins reduce pair checks to 55 |
| Can remembered state replace rescans? | One-pass memory, with a sufficient rule | LastName is useful but has counterexamples |
A fixed filter compares with an unchanged value, such as CityTown == Chennai. An updating comparison uses a changing variable, such as X.Mathematics > Max. A threshold learned from the whole dataset, such as the final mean, must be completed before a second pass uses it. A running mean is not the final mean.
Accumulators can hold totals, counts, extrema or collections. To keep every Physics topper, collect all records equal to the final maximum, including ties. A collection of students is a different output from one maximum value. Procedures make repeated patterns reusable through parameters and return values; their side-effect promises tell callers what remains usable.
Later course material will store relationships for reuse. Here it is enough to see the motivation: compute a useful summary or relationship once, keep it in an appropriate representation, and use it in later work. Do not introduce a complicated structure before identifying what the question needs.
Trace the records, compare the methods and watch what changes. Back and Reset let you try again.
Ready
Choose Next step to follow the actual course records.
Start with Next step. Predict what changes before reading the explanation.
Which pattern finds below-average Maths students correctly?
First compute the final sum and count, so the average is 2171/30. Then scan again and compare each mark with that fixed average. The loops are sequential, not nested.
Can maximum and sum use the same update rule?
No. Sum adds every selected value. Maximum replaces the remembered value only when a larger value appears. Initialization and updates depend on the question.
What should you write down before calling a procedure?
Its inputs and parameter meanings, its return value or values, its assumptions such as valid data, and which order, markers and values it must preserve.
Why preserve the tied maximum students rather than only their mark?
The question “who are the toppers?” asks for identities. One number such as 92 cannot identify every student who achieved it.