Activity 01
Pair Programming: Nested Decision Tree
Pairs design a program that uses nested if/else to categorise student scores into grades with sub-branches for feedback. They test with sample data, swap roles to debug partner's code, and discuss improvements. Extend by adding loop for multiple entries.
Explain how nested conditional statements can handle complex decision-making processes.
Facilitation TipDuring Pair Programming: Nested Decision Tree, have students switch roles between driver and navigator every three minutes to keep both engaged with logic tracing.
What to look forProvide students with a scenario: 'A vending machine dispenses a snack if the correct change is inserted and the item is in stock. If not enough change is inserted, it asks for more. If the item is out of stock, it offers a refund.' Ask students to write pseudocode for this scenario, using at least one 'if/else' and one 'while' loop.