Professional Documents
Culture Documents
Z6707wy6 WR
Z6707wy6 WR
WRITTEN RESPONSES
3 a.
3.a.i.
The purpose of the Board Game Finder app is to assist users to find certain board games with the maximum number of
players they are looking for. The user will now know what games to play depending on how many people there are.
3.a.ii.
The video shows how the user selects the number of players from the range of one to ten in a single dropdown.
3.a.iii.
The user inputs the value using the dropdown. The output, which is a list of games that meet the chosen condition made
by the input, and is then displayed on the screen.
3 b.
3.b.i.
3.b.ii.
3.b.iii.
A list called nameList collects all the games from the database, “Board Games”, and stores them in the list.
3.b.iv.
The nameList is used in the program to show users all the suggested board games that have the capacity as the number
the user has selected. For example, If the user selects the number 4 as the maximum capacity, the filter function
traverses nameList. From the nameList, any game that has a capacity of 4, is added into filterGameList. This is the list
that is outputted to the user.
3.b.v.
The nameList manages complexity because it allows any amount of game names to be stored in a list instead of creating
a variable for each and every single word. This will check every single one of the words to see if they met the
requirements. If this list did not exist, the program would have thousands and thousands lines of code. Even if games
were removed or added, nothing would change and function correctly.
3 c.
3.c.i.
3.c.ii.
3.c.iii.
The filter function contributes to the program because it gathers all the filtered words in a list. The updateScreen function
outputs the filtered list
3.c.iv.
Lines 16 to 20 is the filter function which collects all the words traversed in nameList that meets the certain requirements.
This function uses a parameter which is chosen by the inout made by the user. In order to filter the list, a for loop is used
on line 17 in order to traverse the original list. If it meets all the requirements, it appends the word to the filtered list. The
reset function on line 25 resets the last output to stop repetition. This is done by calling the same list, but since it is
using a different parameter, it will show new sets of games. On line 30, the updateScreen function acts as a base and
outputs everything to the user.
3 d.
3.d.i.
First call:
Let's say the user selects the number 2 from the dropdown
Second call:
Another example, when the user selects the number 4 from the dropdown
3 d.ii.
Condition(s) tested by first call:
The numbers passed to the filter function would be 2 for the parameter: maxInput. Now the for loop will traverse the
elements of each game in nameList (line 17) to check if any games has the maximum players set as 2. This repeats until
the loop finds all the games with a maximum player of 2.
3.d.iii.
Results of the first call:
After the for loop finishes running, any games that had a maximum player of 2 have been added to the filtered list which is
displayed to the user.