A software prototype serves as an early model of the final software, used to visualize and test the basic concepts and functionality. The main purposes of creating a software prototype include:
Q2. Evaluate the following throwaway software prototype. It has been created for a light sequence on the micro:bit. The prototype is moving from a large square to a small square to a clear screen.
- Open the file LightSequence1.py provided by your teacher.
- Connect the micro:bit to t he device w it h the USB cable.
- Flash the program to the micro:bit to test it.
- Discuss these questions with a partner:
Can the images be recognised easily?
Are the images displayed for long enough to be seen clearly?
Do the images flow smoothly from one to another?
What improvements would you make?
Ans :
Steps to Evaluate:
Discussion Questions:
Improvements:
Q3: Evaluate the following evolutionary software prototype. It has been created for two light sequences on t he micro:bit. The software prototype displays:
a large diamond, small diamond then clear screen if the B button is pressed
a large square, small square and then clear screen if the A button is pressed .
- Open the file LightSequence2.py provided by your teacher.
- Connect the micro:bit to t he device with the USB cable.
- Flash the program to the micro:bit to test it.
- Discuss these questions with a partner:
Does the correct light display show when th e A or B button is pressed?
Can the images be recogn ised easily?
Are the images displayed for long enough to be seen clearly?
Do the images flow smoothly from one to another?
What improvements would you make?
Steps to Evaluate:
Discussion Questions:
Improvements:
Throwaway Prototyping:
Evolutionary Prototyping:
Choice: Evolutionary Prototyping
Reasons:
Q1.
Look at the examples of MakeCode and MicroPython below. Discuss with a partner the
patterns you can see:
- Where are the similarities between the code?
- What words are used in MakeCode and MicroPython?
- Are there any words with similar meanings in the two examples?
Ans:
When comparing MakeCode and MicroPython, several patterns and similarities can be observed:
Similarities in Code:
Words Used in MakeCode and MicroPython:
display.show()
, sleep()
, etc.Similar Words with Similar Meanings:
display.show()
sleep()
These commands, despite being represented differently, perform the same actions: displaying an image and pausing execution, respectively.
Q2.
Look at this flowchart and discuss the questions below with a partner. ( start
- What patterns you can see?
- What sequence is being displayed?
- Use the patterns you see to extend the flowchart to display the same
images in the same sequence again.
Ans:
Patterns:
Sequence Displayed:
Extending the Flowchart:
Q3.
Open the file LightSequenceChallenge.py provided by your teacher.
- Look at your flowcha rt from the previous act ivity and add the
MicroPython code to extend the light sequence.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to test it.
Ans:
Connecting and Testing:
Discussion Questions:
Where are the similarities between the code?
What words are used in MakeCode and MicroPython?
display.show()
and sleep()
.Are there any words with similar meanings in the two examples?
display.show()
in MicroPython, and "pause" corresponds to sleep()
.What patterns can you see in the flowchart?
What sequence is being displayed?
How can you use the patterns to extend the flowchart?
MicroPython Code to Extend Light Sequence:
The code provided earlier extends the light sequence by repeating the same steps from the flowchart.
Q1. The flowchart below uses a variable to store an individual value, an integer. An integer is a whole number. Defining the data type
is important: if the program does not know it is an integer, it will not be able to perform a calculation.
- Look at the flowchart. What will be the output?
- What will be the output if the integer stored in the variable number is changed to 5?
Ans:
Let's analyze the given flowchart step by step to determine the output.
### Given Flowchart:
1. **Start**
2. **Set number = 2**
3. **Set total = number × 10**
4. **Output total**
### Steps to find the output:
1. The variable `number` is initialized to `2`.
2. The variable `total` is calculated as `number × 10`, which is `2 × 10`.
3. The value of `total` is then output.
**Output for the given flowchart:**
- \( number = 2 \)
- \( total = 2 \times 10 = 20 \)
- **Output = 20**
### If the integer stored in the variable `number` is changed to `5`:
1. The variable `number` is set to `5`.
2. The variable `total` is calculated as `number × 10`, which is `5 × 10`.
3. The value of `total` is then output.
**Output when `number` is changed to 5:**
- \( number = 5 \)
- \( total = 5 \times 10 = 50 \)
- **Output = 50**
So, the answers are:
1. The output for the given flowchart is **20**.
2. The output if the integer stored in the variable `number` is changed to 5 is **50**.
Q2. The flowchart above can be used to create a program in Python and MicroPython. Look at the Python and MicroPython programs in the table below and write down the patterns you see.
Ans:
Import Statements:
from microbit import *
is required to use the MicroPython-specific functions and hardware features, such as display.scroll()
.Variable Initialization and Arithmetic:
number
with the value 2
and calculate total
as number * 10
.Output Statements:
print(total)
function to output the result to the console.display.scroll(total)
to display the result on the micro's LED display.print()
for console output, while MicroPython uses display.scroll()
for displaying output on the micro.Here is the HTML code that incorporates the analysis and patterns found in the Python and MicroPython programs:
Q3. Open the file CalculationProgram.py provided by your teacher.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to test it.
- Copy and apply the test plan below to predict the outcome and
then test the actual outcome.
Ans:
Open the CalculationProgram.py file:
Connect the micro to your device:
Modify the program according to the test plan:
number
in the program to match each test case.Flash the program to the micro:bit:
Test the program:
Test Number | Data Entered | Expected Outcome | Pass/Fail |
---|---|---|---|
1 | number = 5 | 50 | |
2 | number = 3 | 30 | |
3 | number = 6 | 60 | |
4 | number = 7 | 70 |
Test 1:
number = 5
:50
.number = 3
30
.Test 3:
number = 6
from microbit import * number = 6 total = number * 10 display.scroll(total)
60
.Test 4:
number = 7
from microbit import * number = 7 total = number * 10 display.scroll(total)
70
.By following this process, you can systematically test and verify the correctness of your program using the provided test plan.
Q4. Using the same program, set the variable number to 5 and edit the arithmetic operator to copy and apply the following test plan:
Ans:
Q5. How did pattern recognition help you to complete these tasks? Explain to a partner.
Ans:
Q1.
Look at this flowchart with a sub-routine.
(a) In pairs, follow the flowchart and explain how it works.
(b) What input will allow the sub-routine to run?
(c) How would a sad face be displayed?
Q2. Use the software draw.io to create, view and edit flowcharts:
(a) Open a web browser and the URL https://app.diagrams.net
(b) Open the file SubroutineActivity.drawio provided by your teacher.
(c) Look at the selection used in this program. What will activate the sub-routine?
(d) How will a clear screen be displayed?
(e) The sub-routine should display a large heart followed by a small heart. However, there is an error and the sub-routine is not running at all. Can you find t he error and edit the flowchart? Double-click on the text within a shape to edit the wording.
Q3 . Open the file ANDprogram.py provided by you r teacher. The program displays the word 'Boolean' when the A AND B buttons are pressed. Create a flowchart using draw.io to represent this program.
Q4. Open the file ORprogram.py provided by your teacher. The program displays the word 'Boolean' when the A OR B button is pressed. Create a flowchart using draw.io to represent this program.
Q5. Open the file NOTprogram.py provided by your teacher. The program displays the word 'Boolean' when the B button is NOT pressed. Create a flowchart using draw.io to represent this program.
Q6. Discuss these questions with a partner:
- How could you use a sub-routine to help plan a light sequence for a visual alarm on the micro:bit?
- Think back to the Scenario on page 184 at the start of this unit. How could you use more than one input to activate your visual alarm?
This is the program for the flowchart on page 201.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the m icro:bit.
- Copy the test plan above (leave the pass/fail column blank).
- Apply the test plan to complete the tests on the software prototype and complete the pass/fail column .
Ans:
Q2. Discuss these questions in a small group:
- What did completing the test table show you?
- What is the purpose of a project plan?
- Think back to the Scenario on page 184 at the start of this unit. What tests could be included in a test plan for a visual alarm?
Ans:
Q1.
In a program, the sound sensor on the micro:bit is used to play a tune and display a tick if a loud sound is detected; else it will display a clear screen.
- Open the file DebugProgram.py given t o you by your teacher.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to test it.
- Use the checklist below to identify and debug any errors.
Debug possibilities checklist:
• Does the program start with from microbit im1Port *?
• Are brackets opened and closed when used?
• Is there a colon at the end of an if statement line?
• Are there capitals where there should be, such as the image to be displayed, e.g.
HAPPY?
• Does the string to be displayed have quotation m arks around it?
• Are code words spelled correctly?
- Flash the program to the m icro:bit again to test your debugging.
Q2. Once you have your program running, copy and apply the test plan below to check that the program works as expected.
Q3. Explain to a partner why debugging is important.
- What would happen if you did not test a program before releasing it?
- Give examples of errors that can be introduced when programming in MicroPython.
Q1. Open the file LEDlightsl.py provided by your teacher.
- Edit the program to turn on the bottom-right LED.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to test it.
Q2. Using the file above, edit the file to carry out the following:
Q3. Open the file Pattern1Debug.py provided by your teacher. There is an error when you run this program .
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to see the error.
- Edit the program to match the LEDs displayed for Pattern 1 below.
- Flash the program to the micro:bit to test it.
Q4. Open the file PatternStart.py provided by your teacher.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to see the error. Pattern 1
- Edit the program to match the LEDs displayed for Pattern 2 below.
- Flash the program to the micro:bit to test it.
- Continue to edit the program to display Patterns 3 and 4 below.
Ans:
Q1. In the example above, the program displayed a moving image using two vertical lines.
- Look at the flowchart below. It creates a similar pattern of images using two horizontal lines. Discuss with a partner what the program will do.
- Identify the pattern of where the 9s or Os need to be placed. Copy and complete a grid for each image output.
Ans:
Q2. Open the file HorizontalPattern.py provided by your teacher.
- Using your grids for help, edit the code to create a new moving
sequence of Image 1 followed by Image 2.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to test it.
Ans:
Q3. Discuss with a partner:
- What are the advantages of using more than one image in a light sequence?
- Think back to the Scenario on page 184 at the start of this unit. Will using more than one image help to alert others in a visual alarm?
Ans:
Q1. Create a program for these LED patterns on the micro:bit:
- First, draw the flowchart for the program .
- Using the flowchart, identify the pattern of where the 9s or 0s need to be placed.
Create a grid for each image.
Ans:
Q2. Open the file Sequence1Debug.py provided by your teacher.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to test it.
Ans:
Q3. There are some errors in the program, so the lights are not d isplaying as expected.
- Edit the code to correct the errors.
- Flash the program to the micro:bit to test that t hat it works correctly. It should show
the following output:
Ans:
Q1. Open the file Flowchart plan.docx provided by your teacher.Complete the plan for the following sequence of images.
Ans:
Q2. Open the file SequenceStart.py provided by your teacher.
- Use your flowchart to edit the code to create a program that makes the letter P appear through increasing the brightness in t he image sequence.
- Flash the program to the micro:bit to test that it works correctly.
Ans:
Q3. The images below are for a new light sequence.
- Predict what the out put will be on the micro:bit display.
-Open the file Sequence2Debug.py provided by your teacher.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the m icro:bit to test it.
- Identify the errors that have been made when creating the program code. Find and fix the errors.
- Flash the edited program to the micro:bit to test it.
Ans:
Q4. What is good about being able to control the briqhtness of the LED lights? Think back to the Scenario on page 184 at the start of the unit. How will using brightness help your visual alarm light sequence? Discuss your ideas with a partner.
Ans:
Q1. At the start of this unit, you looked at the use of software prototypes; below is a prototype designed as part of a loading screen for a game on the micro:bit. The following sequence has been planned, but needs to be created as a program. Then the program needs to be tested and evaluated.
Open the file GoFurther.py provided by your teacher.
- Connect the micro:bit to the device with the USB cable.
- Flash the program to the micro:bit to test it.
- Edit the code to create the light sequence shown in the plan above.
- Flash the program to the micro:bit to test that it works correctly. Apply this test plan:
Ans:
Q2. Can you edit the code to incl ude changing the brightness of the LED lights displayed?
Ans:
Q3. Evaluate the program. Discuss with a partner:
- What was good about the loading sequence?
- What could you do to improve the loading sequence?
Ans:
28 videos|17 docs|5 tests
|
1. What are some strategies for improving sequencing and pattern recognition skills? |
2. How can sequencing and pattern recognition skills be applied in real-life situations? |
3. What are some common mistakes people make when trying to improve their sequencing and pattern recognition skills? |
4. How can teachers incorporate sequencing and pattern recognition activities in the classroom? |
5. How can technology be used to enhance sequencing and pattern recognition skills? |
|
Explore Courses for Class 6 exam
|