Add milk and sugar as required. Turn off machine ; Number of sugars required Number of sugars added White coffee required? Wait for coffee to filter through ; 2. The problem solving process used is described in terms of the steps that were taken to address the problem. We can then increment numberOfVansUsed by 1 every time a van is despatched giving us a final count. Pour coffee into cup ;
Does the main problem contain any sub-problems? What is different between the two gatherings? Measure coffee for cups required ; 2. Turn off machine ; Number of sugars required Number of sugars added White coffee required? This convention requires a lower case letter for the first word of the first character of a variable name:
What is the implication of this?
Open the coffee holder ; 3. Find out milkRequired ; 2.
Report numberOfVansUsed ; 7. Variable nameDescriptionRange of values? Where do numberOfVansUsed and heaviestVan get their sopving Despatch van Step through this solution with the following parcel weights: The problem solving process used is clearly described and evaluated. Measure coffee for cups required ; 5.
Problem Solving for Programming Session 4 Calculating and Keeping Track of Values.
A widely used convention for variable naming in programming is to use camel casing. Put water in coffee machine ; 2.
HTTLAP lecture slides
Understand the problem — Devise a plan to solve. Now if the conveyor becomes empty halfway through loading, the incomplete van will be despatched. Despatch van ; 4. Wait for coffee to filter through ; 9. Measure coffee for cups required ; 6. On Saturday, you have another gathering. We would create a variable to count the number of cups poured and keep comparing that to the number of cups required: Httlxp can then increment numberOfVansUsed by 1 every time a van is despatched giving us a final count.
The name of the game Helpful Tools means warehouse worker. At the start of the day the heaviest van sent out is zero, so we initialize heaviestVan to zero. Despatch van ; Do you notice any difference between capacity and the other two variables?
Problem Solving for Programming Session 5 Problems involving arithmetic. – ppt download
Again, the best way to approach the problem is to use the solving framework outlined previously. Which is what we would probably do in problsm real world if we had ten people and only enough coffee for six people.
Find out whether milkRequired ; 2. WHILE room on van 2. We would use the same technique as we did for the sugars loop. Halfway through loading a van, the conveyor becomes empty.
Alison is proposing a solution based proble, the Sokoban game. The van is not kept waiting to see if any lighter parcels that will fit show up.
Although you are primarily focusing on evaluation, this is a problem solving exercise in its own right. The nature of the problem is described but with a lack of cohesion.