
Iteration plans - part 2
In next exercises requirements specifications for a list of program are presented; students are asked to recognize the implied typical goal and the variables required to implement the related plans.
Type: Analysis of requirements specification
Topic: Goals and plans for iteration
Exercise purpose: The exercise helps to acquire the practice of recognizing the main goal in requirements specification before designing and implementing a solution. In particular the aim is to consolidate the terminology relative to iteration goals and plans and to reflect on the variables necessary to implement the different iteration plans and how they must be initialized for the given problem.
Text: in English
Solution: Answers to the questions
Next we have a sequence of exercises that require debugging or writing a function or a program. The requirement specification are mostly taken by the above exercise, hence we assume that students have already reflected on the appropriate plans to be implemented. The purpose of this kind of tasks is to consolidate the knowledge on the specific aspects and structure of each iteration plan.
The first 3 exercises deal with functions that straightforward implement simple plans on slices of integers: in the first exercise we propose a Parsons problem; in the other two, the function must be written from scratch.
Type: Parsons problem
Topic: Goals and plans for iteration
Exercise purpose: In this task the student must recognize the underlying “total plan” and reconstruct it by reordering the instructions into a proper arrangement. The purpose is to consolidate the knowledge on the specific aspects and structure of such plan.
Text: in English
Text attachment: use strange_product_main.go to test the function
Solution: strange_product_sol.go contains the rearranged function.
Type: Program writing from requirements specification
Topic: Goals and plans for iteration
Exercise purpose: Students are asked to write a function that straightforward implements the “repetition plan”. The purpose of this kind of tasks is to consolidate the knowledge on the specific aspects and structure of each iteration plan.
Text: in English
Text attachment: use even_odd_main.go to test the function
Solution: even_odd_sol.go contains the implemented function.
Type: Program writing from requirements specification
Topic: Goals and plans for iteration
Exercise purpose: Students are asked to write a function that implements the plan for the “extreme loop plan” tailored with a “filtering” condition. The purpose is to consolidate the knowledge on the specific aspects and structure of such plan, focusing especially on the role of the initialization of the “most-wanted holder” variable.
Text: in English
Text attachment: use smallest_odd_main.go to test the function
Solution: smallest_odd_sol.go contains the implemented function.
The next 3 exercises deal with functions that implement simple plans on strings. Again, the first one is a Parson problem:
Type: Program writing from requirements specification
Topic: Goals and plans for iteration
Exercise purpose: Students are asked to write a function that straightforward implements the “counting loop plan”. The purpose is to consolidate the knowledge on the specific aspects and structure of such iteration plan.
Text: in English
Text attachment: use how_many_with_a_main.go to test the function
Solution: how_many_with_a.go contains the implemented function.
Type: Program writing from requirements specification
Topic: Goals and plans for iteration
Exercise purpose: Students are asked to write a function that straightforward implements the “linear search plan”. The purpose is to consolidate the knowledge on the specific aspects and structure of such iteration plan.
Text: in English
Text attachment: use first_with_a_main.go to test the function
Solution: first_with_a.go contains the implemented function.
Type: Program writing from requirements specification
Topic: Goals and plans for iteration
Exercise purpose: Students are asked to write a function that straightforward implements the “extreme value plan”. The purpose is to consolidate the knowledge on the specific aspects and structure of such iteration plan.
Text: in English
Text attachment: use shortest_word_main.go to test the function
Solution: shortest_word.go contains the implemented function.