A task defined by the programmer (what it should do and why), performed by a program that meets a set of specifications.
The program you code must build a structure using an Agent (MakeCode) in Minecraft. For example: a petting zoo, a swimming complex, a viewing platform, etc.
These specifications include (for achieved grade): <>Using variables (at least two) storing at least two types of data (e.g. numeric, text, Boolean) <>Using sequence, selection and iteration control structures e.g. a logical well written program, and an if structure, and a loop <>Using input from a user, sensors or another external source e.g. passing a parameter to the chat block, and/or using sensing to determine information about the environment (such as agent detect block) <>Using one or more of: data stored in collections (e.g. an array), or a user-defined functions <>Setting out the program code clearly <>Documenting the program with comments <>Testing and debugging the program to ensure that it works on a sample of expected cases
TASK Complete this Terminology research task to help your understanding of the terms used in this assessment. FOR HIGHER GRADES REFER TO THE ASSESSMENT SCHEDULEComputer Science Intro Learning Resource If you aren't familiar with the concepts of computer programming or using the Code Connection to program in Minecraft this resource will help a lot. https://minecraft.makecode.com/courses/csintro
Variables are used in computer programming to store specific values within a program. They are assigned both a data type as well as a value. There are three types of variables (two different types must be used): numeric, text, boolean – true or false. Using Variables including: 1. Setting (or assigning) a variable to a value of certain data type 2. Changing the value of a variable 3. Using variables in blocks of code
Working out errors in code can be difficult; one tool in code connection you can use is the slowstep tool. Watch the slowstep tool video. It is used with the measure distance code.
DECLARATION OF & USE OF VARIABLES
The set block for declaring a variable and assigning it a value should be put before the code using the variable occurs. If this is not done, an error message will happen. It also makes it easier to understand the program as this habit allows programmers to know what variables are being used, their datatype and the values they are initially given. It is good practice to use variable names that describe what the variable is being used for e.g. dist could the name of a numeric variable that measures a distance.
THE ORDER (OR SEQUENCE) OF CODE
The sequence of the block changes the way the code works. If the code breaks, a rule like not declaring a variable an error message is sent from the interpreter. If the code does not break a rule but is not logically correct (semantically) then it will not do what you want. Sequential execution: all programming languages run from top to bottom, one block of code after the other.
Iteration: this repetition. A loop that repeats something until a condition is met. There are three types of loops (and two variations of the For loop): 1. For a. For element … of … b. For … from 0 to … 2. While 3. Repeat