System: You are ChatGPT, a large language model trained by OpenAI.
User: I will send you a body of text, I will then state what you do next.
User: 2 1 Programming basicsINTRODUCTIONIn its simplest form a computer program can be seen as a list of instructions that a computer has to work through in a logical sequence in order to carry out a speciﬁ  c task. The instructions that  make up a program are all stored in memory  on the computer along with the dat a that is needed to make the program work. Programs (also known as applications or apps) are created by writing lines of code to carry out algorithms. An algorithm  is the steps required to pe rform a particular task and the programming code contains the actual instructions written in a programming language. This language is in itself an application that has been written by someone else to enable you to write your own programs. In the same way that there are lots of different languages you can learn to speak, there are also lots of programming languages, and in the same way that some languages have many different dialects, there are also different versions of some of the more popular programming languages.
 Another similarity with natural languages is that each programming language has its own vocabulary and rules that deﬁ  ne how the words must be put together. These rules are known as the syntax  of the lang uage. The difference between learning a foreign (natural) language and a computer language is that there are far fewer words to learn in a computer language but the rules are much more rigid.LEARNING OBJECTIVES In this chapter you will learn: •the basic principles of writing instructions in the form ofprogramming code •what constants and variables are and how to use them•what the main data types are •how to store data using meaningful names.SPECIFICATION COVERAGE3.1.1.1 Data types 3.1.1.2 Programming concepts3.1.1.6 Constants and variables in a programming language3.5.1.2 IntegersKEYWORDS Memory: the location where instr uctions and data are stored on the computer. Algorithm: a sequence of steps that can be followed to complete a task and that always terminates.
 Syntax: the rules of how words are used within a given language.3CONSTANTS AND VARIABLES ●Naming and storing data In addition to instructions, the computer program also needs data to work with. For example, to add two numbers together requires an add  instructionand then the two numbers that need to be added. You need to give these twodata items names so that the computer will know which data to use. The data are stored in memory along with the instructions. You could viewmemory rather like a series of pigeon-holes, each having a unique address,known as a memory address .It is a rea lly good idea to use names that indicate the purpose of the data – in the case of the example above the two numbers might be calledNumber1  and Number2 . Using meaningful names will help you when theyare trying to trace bugs and it also allows other programmers to follow thecode more easily. It is good practice to adopt a common naming convention.In this case the first character in upper case and the rest in lower case. This process of giving data values is called ‘assigning’, and it looksomething like these two: Number1 23 Name  "Derek"The  means ‘becomes’ or ‘equals’. Number1  is an example of a variable. In the example above it has been given a value of 23 , though this value will change while the program is being run. Name  is another example of a variable and has been given the value "Derek".  Different programming languages have slightly different ways of assigning values. For example, you may need to use the equals sign to make the assignment  in the code you are writing. So a simple algorithm to add two number s together might look like this: Number1 = 2Number2 = 3Answer = Number1 + Number2Figure 1.1 shows a simplified visualisation of how this program is handled. There will be millions of memory addresses, of which just three are shown in this diagram.
 Memory address 1000 1001 1002Number1 Variable2 Data 3 5Number2 Answer Figure 1.1 ●Constants and variablesData are stored either as constants  or as variables . Constants (as you’d expect from the name) have values that are fixed for the duration of a program. For example, if you were writing a program that converted milesinto kilometres you could set the conversion rate as a constant because it willnever change. In this case we could call the constant ConvertMilestoKmand assign it a value of 1.6 as there are approximately 1.6 km to the mile.Then whenever we want to convert a distance in miles to its metric equivalentwe would multiply it by the constant ConvertMilestoKm .KEYWORD Assignment: the process of giving a value to a variable or constant.KEYWORD Memory address: a specific location in memory where instructions or data are stored. KEYWORDSConstant: an item of data whose value does not change.
 Variable: an item of data whose value could change while the program is being run.1 Programming basics4Notice that the name given to the constant is self-explanatory. We could have just called it Constant1 . However, by giving it a meaningful name it makes the code easier to work with as the program gets bigger. It also makes it easier for anyone else that looks at the code, to work out what the program is doing. This is important for three main reasons: ●It makes it easier to find and correct errors/bugs in code. This is calledebugging . ●There are many occasions where there are several programmers workingon the same program at the same time, so having a sensible naming convention makes it easier for everyone to understand. ●It will be easier to update the code later on when further versions of thepro gram are created.
 The value of variables can change as a program is being run. For example, the same conversion program will require the user to type in the number of miles they want to convert. This number will probably be different each time the user enters data. Therefore, you need to have a variable that you could call NumberOfMiles . There are lots of other examples – the number of answers a pupil has got right in a test would (hopefully) increase as they work their way through a test so the data would have to be stored as a variable. The password a user uses to access a network can be changed at any time, so it would also be classed as a variable. Variable and constant declarationDeclaring a constant or variable means that when you are writing code you describe (or declare) the variables and constants that you are going to use before you actually use them in your program. Some programming languages force you to declare the variables and constants you intend to use in your program before you start writing any code. The benefits of doing this are that it forces you to plan first and the computer will quickly identify variables it does not recognise. There are two parts to a declaration . You need to supply a suitable name for the constant/variable and you need to specify the data type that will be used. The declarations might look something like this: Dimension Age As IntegerDimension Name As StringDimension WearsGlasses As BooleanDimension  or Dim  is one of the command words used in Visual Basic to indicate that a variable is being declared. Once you have declared a variable it starts with a default value. In the above examples Age  will start as zero, Name  as nothing (also known as the empty string) and WearsGlasses  will start with the value False. Other languages may use different default values so it is good practice to assign an initial value to the variable just to make sure it is correct. ●Data typesIt is important to consider how you want your program to handle data. Forexample, to create the miles to kilometres conversion program, you have totell the program that miles and kilometres both need to be stored as numbers.KEYWORD Debug: the process of finding and corr ecting errors in programs. KEYWORDeclaration: the process of definingvariables and constants in terms of their name and data type.DATA TYPES5There are lots of data types you might need to use and you need to think carefully about the best type to use. For example, if storing numbers, how accurate do you need the number to be? Will a whole number be accurate enough or will you need decimals? In addition to numbers, you will probably want to store other data such as a person’s name, their date of birth or their gender. All programming languages offer a range of data types but the actual name of the data type may vary from language to language. Here are some of the most common data types: ●Integer: This is the mathematical name for any positive or negativewhole number. This might be used to store the number of cars sold in a particular month or the number of pupils in a class. The range ofnumbers that can be stored depends on how much memory is allocated.For example, an integer  in Visual Basic can store numbers between–2 147 48 3 648 through to +2 147 483 647.  Declaring a number as an integer means that the program will thenhandle the data accordingly. For example, 2 + 3 will equal 5. In somelanguages, if you did not set it to integer 2 + 3 would equal 23 (two three).
 ●Real/Float: This is a number that has a fractional or decimal part, forexa mple 3.5 or 3  1_2 . In our miles to kilometres conversion program, you would need to store both miles and kilometres using this data type as theuser might want to convert a number that is not a whole number. Otherexamples might include a person’s height in metres or their weight inkilograms.
 ●Text/String: This data type is used to store characters, which could betext or numbers. For example, you could use this to store a person’s name or address. Some programming languages refer to this data type asalphanumeric because you can actually store any character you want in astring whilst text implies it can only store letters. Text or string variablesare normally shown in quotation marks. For example you might assignthe name Frank to a variable like this: Name  "Frank" . Housenumbers and phone numbers are often stored as text / string as althoughthey are numbers, you would never need to carry out any calculations onthem and in the case of telephone numbers the leading zero is importantand would be omitted if stored as a number. ●Boolean: The simplest data type is a simple yes/no or true/false. Thisis ca lled a Boolean data type. It is named after George Boole whodiscovered the principles behind logic statements. Boolean data typescan be used to store any kind of data where there are two possible values. ●Character: This data type allows you to store an individual character,which might be a letter, number or symbol. All computers have a defined character set, which is the range of characters that it understands. Thiswould commonly be all the upper and lower case letters, plus otherkeyboard characters and any special characters. ●Date/Time: This will store data in a format that is easily identifiable asa date or time, e.g. 30.04.2014 or 12: 30. The program will then handle the data accordingly. For example, if you added 5 to the date, it wouldtell you the date in five days’ time. 30.05.2014 + 5 would become04.06.2015. If you did not declare it as a date you may get the wronganswer, for example 30.05.2019. ●Pointer/Reference: This data type is used to store a value that will point to oreference a location in the memory of the computer. If you think of memoryKEYWORD Data type: determines what sort of data are being stored and how it will be handled by the program.
 KEYWORDInteger: any whole positive or negative number including zero.1 Programming basics 6as a series of pigeon-holes or addresses where instructions and data are stored, the pointer /reference is used in a program to go to a specific address. For example, you could set up a pointer called Pointer1  and put address 1001 in it. The program would then go to memory address 1001 and take the data from it. In the example below it would be the data assigned to Number2 . Other lines of code will then be needed to tell the program what to do with the data it ﬁnds there. Figure 1.2 shows how a pointer is used to reference an item of data.
 Memory address 1000 1001 1003Number1Pointer1 = 1001 Number21002Add Answer Figure 1.2●Array: An arra y is a collection of data items of the same type. For example, if you wanted to store a collection of names in a school register, you could call this Register  and each item of data would be storedas text. Each individual name in the array is called an element . Every element is numbered so that Register(2)  would be the second personin the array, Register(4)  the fourth person and so on. Note that 0 is often used as the ﬁrst element of an array, rather than 1. If this was the case then Register(2)  would actually be the third person in the array,Register(4)  the ﬁfth and so on. Figure 1.3 shows a simple array with six elements. Register(2) =Hussain , Register(4) = Schmidt  (assuming array indexing starts at 1).
 ●Records: This is used to store a collection of related data items, wherethe i tems all have different data types. For example, you might setup a record  called Book , whic h is used to store the title, author name and ISBN of a book. Title and Author  are text whereas thePublicationDate  is set as a Date data type. You could write it like this: Book = RecordTitle, Author As Text * 50 ISBN As Text * 13PublicationDate As DateWhen the program is run, every time data are entered for the book, the user will type in up to 50 characters of text for the title and author and then the ISBN. A variable could now be set up using this record data type and this variable would contain all of this data.
 ●Built-in and user-defined data typesBuilt-in data types are those that are provided with the programminglanguage that you are using. The list of built-in types varies from languageto language, but all will include versions of the types listed above. Most programming languages allow users to make up their own data types,usually by combining existing data types together. These are simply calleduser-defined data types. For example, if you were making a program tostore user names and IDs, you may create a user-defined data type calledLogon  made up of a set number of characters and numbers.Figure 1.3Brown HussainKoening SchmidtTorvillWestKEYWORD Pointer: a data item that identi fies a particular element in a data structure – normally the front or rear.
 KEYWORDSArray: a set of related data items stored under a single identifier. Can work on one or more dimensions.
 Element: an single value within a set or  list – also called a member.
 Record: one line of a text file.BUILT-IN AND USER-DEFINED DATA TYPES7Type Logon    UserName As String * 10   UserID As Integer * 5 End TypeThis code will set a new data type called Logon , which will be made up of a 10-character user name followed by a 5-digit user ID. In total, the data type will have 15 characters/digits to store the data. The reasons for creating user-defined types are mainly to do with efficiency. As you start to write your own programs you will find that they can get very long and complex and that debugging can be very time-consuming. Most programmers try to make their code as organised and efficient as possible as this will save them time as the program develops. For example, it is easier to reuse a block of code rather than have to write it all over again. Most programmers aim to create code that is ‘elegant’. This means that it does exactly what it is supposed to do as efficiently as possible. Often this means writing as few lines of code as possible with no repeated coding. Using a user-defined data type is just one example of where it is possible to be more efficient. With our example of storing Logon  information using a user-defined variable, because all the data are stored in one variable rather than two, when the program needs this information, we only need to access one variable rather than two.
 Practice questions can be found at the end of the section on pages 46 and 47. STUDY / RESEARCH TASKS1 A list of data is also known as a one-dimensional array. Find out what  two- and three-dimensional arrays are and give examples of where you might use each.2 Identify the built-in data types for the main programming language that is used in your school or college.3 Research data types that are speciﬁcally used to store sound and video data. How do they differ from other data types?TASKS1 Give two reasons why it is a good idea to use meaningful variable names. 2 Use examples to explain the difference between a constant and a  variable.3 Why is it important to declare all variables and constants at the  beginning of a program?4 Explain the difference between a value and a variable.
 5 Suggest suitable data types and variable names for: a)the current rate of VATb)today’s date c)the total takings from a shopd)a person’s date of birth e)which wrist a person wears a watch on.KEY POINTS•Programming languages areused to write applications (apps). •An algorithm is a sequenceof instructions that can be followed to complete a task.Algorithms always terminate.
 •Programming code ismade up of algorithms that are implemented within aprogramming language.
 •Instructions are stored inmemory along with the data required by the program.
 •Data are stored and namedaccording to certain conventions.
 •Variables and constants areused to store data and must be declared in some languages.
 •There are several datatypes built in to every programming language andthe programmer can alsodeﬁne their own.
User: Make the following text more clear.
Format it properly.
Do NOT change the meaning of the words or methods used to obtain the answer or anything like that.
This is for AQA A(S)-Level Computer Science. I repeat, do not alter the words as it could have an effect on the marks acquired from the marking scheme.
However, remove any redundant information or USELESS examples that are not needed for a student to know, or simplify unnecessary information (if it has a definition or keywords, it is not unnecessary).
If you can, use different values for the examples.
For things that will not score a mark or are generally useless, for example, "we will cover" or a fun fact, change the wording.
Link the 'sections' of your answer to the following spec-points (by title):
e.g. "**Topic** (Spec Points: a.b.c. Whatever)
3.1.1.6 Constants and variables in a programming language
None

3.5.1.2 Integers
None

3.1.1.1 Data types
None

3.1.1.2 Programming concepts
None


You MUST make sure they are ALL met. Everything it says on there you should meet.

I already provided the available exam questions you MAY choose to add on to the notes, with 'des' explaining what it's about, and 'fil' meaning the Question ID.
The content, too. Delivered in the form 'fil', JSON
Ignore exam questions that contain 'Skeleton Program'. Do not only put like 2 exam questions, try to put more!
For the exam questions, in the original text, there is a label named 'Tasks'. Those (usually) six questions are NOT the exa questions. The exam questions are the ones that were given in JSON form to you, do NOT do the 'Tasks'. Do the exam questions that contain HTML in JSON!

In the markscheme, a ';' typically means that a mark was gained.
When mentioning exam questions, you *must* answer them, according to the markscheme, scoring full marks. No 'do it yourself'.

If necessary for scoring marks, try to embed the exam-questions into your notes, sometimes without even referencing the fact that it is an exam question. For example, if an exam question is a definition or benefits, use the answer in your notes.
Remember. DO NOT ADD USELESS STUFF. Your task is to create the MOST EFFICIENT (SHORTEST [for an explanation] BUT STILL SCORES ALL MARKS) possible notes resource, which will score all marks easily, so its wording has to be mostly like that of the exam questions. By any means, if necessary, please include examples and exam questions! At the end you can have a 'try these exam questions' thing.
At the end of your answer, you will give a 'breakdown'/'summary' of each thing you covered which will tell the most concise FULLY MARK-SCORING explanation possible.

In summary, your answer must:

* Be efficient, useful
* For topics in an exam that may require some form of mathematical working, always show an example of a question.
* Be clear – provide clear, step-by-step examples/instructions when needed.
* Follow the entire specification and everything it says.
* Link your section to a spec point. E.g. **Topic** (Spec Points: a.b.c Whatever)
* Score ALL marks.
* Include ALL exam questions S at the end (except ones that contain 'Skeleton Program'), with the same wording as the original ones in the JSONs sent to you – and INCLUDE THE QUESTION CONTENT, AND THE ANSWERS/MARK SCHEME. Only the ones that I provided to you, include Question IDs.
* Remove redundant, unnecessary and useless information that would not be brought up in an exam answer.
* Be helpful to the reader
* Include all definitions, do not change the wording (unless that definition is an exam question). Incorporate the definitons into the notes.
* Include a summary at the end that goes through everything you need to score all marks.

At the end of the formatted text, after everything is done, fill out the JSON:
Remove the type clarification.
{
"chapter": (int),
"page": (int),
"chapter_name": (str),
"topics": (list)
}

User: And these are the available exam questions, with 'des' explaining what it's about, and 'fil' meaning the Question ID.
{'S1$.1.f': [{'index1': '|D.A$|K$|', 'index2': '|2$|', 'index3': '3$', 'index4': 'S1$.1.f', 'index5': '|12$|', 'index6': 'Q20S1B06', 'qid': 'Q20S1B06', 'des': 'State reasons why values are stored as constants in the Skeleton Program', 'index7': '', 'marks': '2 marks', 'time': '2', 'ttext': 'Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q20S1B06', 'year': 2020, 'res': '/RESOURCES/AA_COM/RESOURCES/AS_P1_Section_B_Summer2020.html', 'flag1': None}], None: [], 'S1$.1.a': [{'index1': '|D.A$|', 'index2': '|2$|', 'index3': '2$', 'index4': 'S1$.1.a', 'index5': '|', 'index6': 'Q22S1B04p1', 'qid': 'Q22S1B04p1', 'des': 'State the most appropriate data type for whole numbers; integer', 'index7': '', 'marks': '1 marks', 'time': '1', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'Q22S1B04P1', 'year': 2023, 'res': '', 'flag1': None}, {'index1': '|D.A$|K$|', 'index2': '|2$|', 'index3': '2$', 'index4': 'S1$.1.a', 'index5': '|19$|', 'index6': 'Q22S1B04p2', 'qid': 'Q22S1B04p2', 'des': 'State identifier of variable in Skeleton Program for whole numbers; integer', 'index7': '', 'marks': '1 marks', 'time': '1', 'ttext': 'Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q22S1B04P2', 'year': 2023, 'res': '/RESOURCES/AA_COM/RESOURCES/2022_AS_SectionB_resources.html', 'flag1': None}, {'index1': '|D.A$|K$|', 'index2': '|2$|', 'index3': '2$', 'index4': 'S1$.1.a', 'index5': '|19$|', 'index6': 'Q22S1B05', 'qid': 'Q22S1B05', 'des': 'State identifier and data type of variable in skeleton program with two values; Boolean', 'index7': '', 'marks': '2 marks', 'time': '3', 'ttext': 'Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q22S1B05', 'year': 2023, 'res': '/RESOURCES/AA_COM/RESOURCES/2022_AS_SectionB_resources.html', 'flag1': None}], 'S1$.1.b': [{'index1': '|D.A$|', 'index2': '|2$|', 'index3': '2$', 'index4': 'S1$.1.b', 'index5': '|', 'index6': 'Q22S1B09p1', 'qid': 'Q22S1B09p1', 'des': 'Explain differences between definite and indefinite iteration; loops', 'index7': '', 'marks': '2 marks', 'time': '3', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'Q22S1B09P1', 'year': 2023, 'res': '', 'flag1': None}, {'index1': '|D.A$|K$|', 'index2': '|2$|', 'index3': '2$', 'index4': 'S1$.1.b', 'index5': '|19$|', 'index6': 'Q22S1B09p2', 'qid': 'Q22S1B09p2', 'des': 'State identifier of subroutine in skeleton program that uses definite iteration; loops', 'index7': '', 'marks': '1 marks', 'time': '1', 'ttext': 'Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q22S1B09P2', 'year': 2023, 'res': '/RESOURCES/AA_COM/RESOURCES/2022_AS_SectionB_resources.html', 'flag1': None}, {'index1': '|D.A$|K$|', 'index2': '|2$|', 'index3': '2$', 'index4': 'S1$.1.b', 'index5': '|19$|', 'index6': 'Q22S1B09p3', 'qid': 'Q22S1B09p3', 'des': 'State identifier of subroutine in skeleton program that uses indefinite iteration; loops', 'index7': '', 'marks': '1 marks', 'time': '1', 'ttext': 'Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q22S1B09P3', 'year': 2023, 'res': '/RESOURCES/AA_COM/RESOURCES/2022_AS_SectionB_resources.html', 'flag1': None}, {'index1': '|D.A$|D.C$|K$|', 'index2': '|3$|', 'index3': '1$', 'index4': 'S1$.1.b', 'index5': '|21$|', 'index6': 'QS17L1PM', 'qid': 'QS17L1PM', 'des': 'PM - Rabbits and Foxes', 'index7': '', 'marks': '0 marks', 'time': '0', 'ttext': 'Programming concepts | Practical programming | Preliminary material', 'fld': 'AA_COM', 'fil': 'QS17L1PM', 'year': 2017, 'res': '/RESOURCES/AA_COM/RESOURCES/AL_P1_Summer2017.html', 'flag1': 1}, {'index1': '|K$|', 'index2': '|2$|', 'index3': '1$', 'index4': 'S1$.1.b', 'index5': '|7$|', 'index6': 'QS171PM', 'qid': 'QS171PM', 'des': 'PM - Capture the Sarrum', 'index7': '', 'marks': '0 marks', 'time': '0', 'ttext': 'Preliminary material', 'fld': 'AA_COM', 'fil': 'QS171PM', 'year': 2017, 'res': '/RESOURCES/AA_COM/RESOURCES/COMP1Summer2017.html', 'flag1': 0}]}

User: These are the content of said exam questions, these are the ONLY exam questions, you will use these later, delivered in form 'fil', JSON: {'Q20S1B06': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This question refers to the constants set at the beginning of the <b>Skeleton Program</b>.</p>\r\n<p class="indent1new">It is a good programming technique to use a named constant rather than the value it represents.</p>\r\n<p class="indent1new m-b-1">State a reason why each of the following are set as constants. Your answers for part (a) and (b) must be different.</p>\r\n<p class="indent1">(a)&emsp;&nbsp;<span class="comp">EMPTY_STRING</span></p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&emsp;&nbsp;<span class="comp">MAX_WIDTH</span></p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(1)</p>\r\n<p class="mark">(Total 2 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="questiona">(a)&emsp;&nbsp;<b>Mark is for AO1 (understand)</b> </p>\r\n<p class="indent2new indentright">It is easier to read / understand / more descriptive (the identifier) than &quot;&quot;;</p>\r\n<p class="indent2new indentright m-t-0">It will never change // a change in value would invalidate the name EMPTY_STRING, <b>R.</b> the value never changes <u>in this program;</u></p>\r\n<p class="indent2new indentright m-t-0">If there was a requirement to change the representation of the empty string it would only need to be changed in one place;</p>\r\n<p class="indent2new indentright m-t-0">The value cannot be accidentally changed elsewhere in the code (<b>Do NOT accept</b> for Python);</p>\r\n<p class="indent2new indentright"><b>A.</b> since the name is uppercase this tells the programmer not to alter it. (Python only)</p>\r\n<p class="indent2new indentright"><b>Max 1</b></p>\r\n<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&emsp;&nbsp;<b>Mark is for AO1 (understand)</b> </p>\r\n<p class="indent2new indentright">(These are the maximum dimensions and) may be changed easily if the program requirements change // a change would only need to be made in one place; It is easier to read/understand than the actual values;</p>\r\n<p class="indent2new indentright m-t-0">The value cannot be accidentally changed elsewhere in the code (<b>Do NOT accept</b> for Python);</p>\r\n<p class="indent2new indentright"><b>A.</b> since the name is uppercase this tells the programmer not to alter it. (Python only)</p>\r\n<p class="indent2new indentright m-t-0"><b>R.</b> if answer is the same as <b>(a)</b></p>\r\n<p class="indent2new indentright"><b>Max 1</b></p>\r\n<p class="levelms">1</p>\r\n<p class="mark">[2]</p></h5>', 'examinerreport': '', 'notes': '', 'resources': ''}, 'Q22S1B04P1': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">State the most appropriate data type to use for whole numbers.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 1 mark)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>Mark is for AO1 (knowledge)</b> </p>\r\n<p class="indent1new comp-top">Integer / int;</p>\r\n<p class="mark">[1]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">The majority of students gained both marks.</p></h5>', 'notes': '', 'resources': ''}, 'Q22S1B04P2': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">State the identifier of a variable in the <b>Skeleton Program</b> that can only represent whole numbers.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 1 mark)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>Mark is for AO2 (analyse)</b> </p>\r\n<p class="indent1new indentright comp-top">Line / Row / Column / ErrorCount / ResponseNumber;</p>\r\n<p class="indent1new indentright"><b>A.</b> <span class="comp">GRID_SIZE</span> (Python only)</p>\r\n<p class="indent1new indentright m-t-0"><b>R.</b> <span class="comp">Digit</span></p>\r\n<p class="indent1new indentright m-t-0"><b>R.</b> if any additional code</p>\r\n<p class="indent1new indentright m-t-0"><b>R.</b> if spelt incorrectly</p>\r\n<p class="indent1new indentright m-t-0"><b>I.</b> case and spacing</p>\r\n<p class="mark">[1]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">The majority of students gained both marks.</p></h5>', 'notes': '', 'resources': ''}, 'Q22S1B05': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">State the identifier <b>and</b> data type of a variable in the <b>Skeleton Program</b> that can only represent two different values.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 2 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>1 mark for AO1 (knowledge) and 1 mark for AO2 (analyse)</b></p>\r\n<p class="indent1new indentright">Identifier (AO2): <span class="comp-top">OK / InputError / Finished / Solved / Correct / Incomplete;</span></p>\r\n<p class="indent1new indentright m-t-0">Data type (AO1): <span class="comp">Boolean / bool;</span></p>\r\n<p class="indent1new indentright"><b>R.</b> if any additional code</p>\r\n<p class="indent1new indentright m-t-0"><b>R.</b> if spelt incorrectly</p>\r\n<p class="indent1new indentright m-t-0"><b>I.</b> case and spacing</p>\r\n<p class="mark">[2]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">The majority of students gained both marks.</p></h5>', 'notes': '', 'resources': ''}, 'Q22S1B09P1': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Explain the differences between definite and indefinite iteration.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 2 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>2 marks for AO1 (understand)</b></p>\r\n<p class="indent1new indentright">Definite iteration: the number of iterations is known (at the time of execution);</p>\r\n<p class="indent1new indentright m-t-0">Indefinite iteration: the number of iterations depends on a condition (that is tested before / after each iteration);</p>\r\n<p class="indent1new indentright"><b>NE.</b> indefinite iteration: number of iterations not known</p>\r\n<p class="mark">[2]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Many students failed to secure full marks in this question, with responses that were insufficiently specific rather than incorrect. The most common way in which a mark was dropped was to correctly define definite iteration, and then to present indefinite iteration as the opposite of definite iteration. Where a mark is available for providing a definition, a standalone definition should be provided.</p></h5>', 'notes': '', 'resources': ''}, 'Q22S1B09P2': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">State the identifier of a subroutine in the <b>Skeleton Program</b> that contains <b>definite</b> iteration.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 1 mark)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>Mark is for AO2 (analyse)</b></p>\r\n<p class="indent1new indentright comp-top">ResetDataStructures / LoadSolution / ResetAnswer / TransferAnswerIntoGrid / DisplayGrid / KeepPuzzle / CheckSolution / DisplayResults;</p>\r\n<p class="indent1new indentright"><b>R.</b> if any additional code</p>\r\n<p class="indent1new indentright m-t-0"><b>R.</b> if spelt incorrectly</p>\r\n<p class="indent1new indentright m-t-0"><b>I</b> case and spacing</p>\r\n<p class="mark">[1]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This question required students to identify subroutines that contained examples of definite and indefinite iteration. The majority of students secured this mark.</p></h5>', 'notes': '', 'resources': ''}, 'Q22S1B09P3': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">State the identifier of a subroutine in the <b>Skeleton Program</b> that contains <b>indefinite</b> iteration.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 1 mark)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>Mark is for AO2 (analyse)</b></p>\r\n<p class="indent1new indentright comp-top">LoadPuzzleFile / TransferPuzzleIntoGrid / LoadPartSolvedPuzzle / SolvePuzzle / GetMenuOption / NumberPuzzle;</p>\r\n<p class="indent1new indentright"><b>R.</b> if any additional code</p>\r\n<p class="indent1new indentright m-t-0"><b>R.</b> if spelt incorrectly</p>\r\n<p class="indent1new indentright m-t-0"><b>I</b> case and spacing</p>\r\n<p class="mark">[1]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This question required students to identify subroutines that contained examples of definite and indefinite iteration. The majority of students secured this mark.</p></h5>', 'notes': '', 'resources': ''}, 'QS17L1PM': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>RABBITS AND FOXES</b></p>\r\n<p class="indent1new">Scientists are often interested in predicting how the population of a species of animal might change over time. Significant changes can have an impact on other animal species as well as on food production for humans. There are a huge number of factors that can impact on population, making it far too complex for us to be able to predict population changes with one hundred per cent accuracy in the real world. Scientists often develop computer models to try to predict how population may change over time; a computer model is an abstraction of a real world scenario. Scientists can use the computer model to make predictions about likely population changes in the real world. When a computer model is run it is called a simulation.</p>\r\n<p class="indent1new">The more accurate the rules in the computer model are, the more reliable the predictions based on the outputs of the computer model will be.</p>\r\n<p class="indent1new">The <b>Skeleton Program</b> accompanying this <b>Preliminary Material</b> is a program that models the population of rabbits and red foxes on an island.</p>\r\n<p class="bottom">&nbsp;</p>\r\n<table class="data-table left1">\r\n\t<tr>\r\n\t\t<td class="col-10 no-border"><p class="padded"><img src="AA_COM/QS17L1PM_files_Q/img01.jpg"/>&nbsp;</p></td>\r\n\t\t<td class="col-12 no-border vert-top">\r\n\t\t<p class="padded text-left">Rabbits live in a collection of underground burrows called a warren.</p>\r\n\t\t<p class="padded text-left">They feed on grass and leafy plants. Rabbits breed at a fast rate and it is not unknown for rabbit populations to grow almost exponentially, which can cause significant ecological problems.</p>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n<p class="bottom">&nbsp;</p>\r\n<table class="data-table left1">\r\n\t<tr>\r\n\t\t<td class="col-10 no-border"><p class="padded"><img src="AA_COM/QS17L1PM_files_Q/img02.jpg"/>&nbsp;</p></td>\r\n\t\t<td class="col-12 no-border vert-top">\r\n\t\t<p class="padded text-left">Red foxes tend to hunt for food on their own, ranging over a wide geographical area in their search for prey.</p>\r\n\t\t<p class="padded text-left">Red foxes will eat many different animals but rabbits are their main prey.</p>\r\n\t\t</td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new m-t-0">In the simulation in the <b>Skeleton Program</b> the island is represented by a square grid (the landscape). Each cell in the grid can contain either a rabbit warren or a fox or both. A rabbit warren is represented by a number that indicates the number of rabbits currently living in the warren and a fox is represented by the letter <b>F</b>.</p>\r\n<p class="indent1new"><b>Table 1</b> describes some of the data stored about each <b>fox</b>.</p>\r\n<p class="graph"><b>Table 1</b></p>\r\n<p class="bottom">&nbsp;</p>\r\n<table class="data-table left1">\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left"><b>Attribute</b></p></td>\r\n\t\t<td class="col-15"><p class="padded text-left"><b>Description</b></p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">ID</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">A unique number allocated to each animal.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Age</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The fox&#8217;s age in years (starting value is 0). If a fox does not get enough food it will age at a faster rate.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Natural lifespan</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">Indicates the age at which the fox will die of old age. If default values are used then the lifespan for each fox will be 7.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Probability of death from other causes</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The percentage chance that, when the simulation is advanced to the next time period, the fox will die from a cause other than old age or lack of food (eg disease or being hit by a car). If default values are used then the probability of death from other causes for each fox will be 10%.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Food units needed</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The number of rabbits the fox needs to eat in one time period to stay healthy. If default values are used then the food units needed for each fox will be 10.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Food units consumed</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The number of rabbits the fox has eaten in the last time period. If a fox hasn’t eaten any rabbits it will die. If a fox hasn’t eaten as many rabbits as indicated by the food units needed attribute then the fox will age at a faster rate.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new"><b>Table 2</b> describes some of the data stored about each <b>rabbit</b>.</p>\r\n<p class="graph"><b>Table 2</b></p>\r\n<p class="bottom">&nbsp;</p>\r\n<table class="data-table left1">\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left"><b>Attribute</b></p></td>\r\n\t\t<td class="col-15"><p class="padded text-left"><b>Description</b></p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">ID</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">A unique number allocated to each animal.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Age</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The rabbit’s age in years (starting value is 0).</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Natural lifespan</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">Indicates the age at which the rabbit will die of old age. If default values are used then the lifespan for each rabbit will be 4.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Probability of death from other causes</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The percentage chance that, when the simulation is advanced to the next time period, a rabbit will die from a cause other than old age or lack of food (eg being hit by a car or being eaten by a predator other than a fox). If default values are used then the probability of death from other causes for each rabbit will be 5%.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Reproduction rate</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">If default values are used then the reproduction rate for each rabbit will be 1.2. The higher the reproduction rate the higher the likelihood that this rabbit will mate with another rabbit (of a different gender) and have a kit (baby rabbit) that survives its first time period.</p></td>\r\n\t</tr><tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Gender</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The gender of a rabbit. When a rabbit is born there is a 50% chance that it will be male and a 50% chance that it will be female.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new"><b>Table 3</b> describes some of the data stored about each <b>warren</b>.</p>\r\n<p class="graph"><b>Table 3</b></p>\r\n<p class="bottom">&nbsp;</p>\r\n<table class="data-table left1">\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left"><b>Attribute</b></p></td>\r\n\t\t<td class="col-15"><p class="padded text-left"><b>Description</b></p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Rabbits</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">A list containing all the rabbits currently living in the warren.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Periods run</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The number of time periods that the warren has existed within the simulation.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Rabbit count</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">The number of rabbits currently living in the warren.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-10"><p class="padded text-left">Already spread</p></td>\r\n\t\t<td class="col-15"><p class="padded text-left">This attribute indicates if the warren has already spread into a new warren. There is a maximum size of 99 for a warren (the maximum number of rabbits that can live in a warren) and when this value is reached for the first time a new warren is created at a random location in the landscape.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">In the <b>Skeleton Program</b> there is a main menu containing three options.</p>\r\n<p class="indent1new">The first option is to run the simulation with default settings. The second option is to run the simulation with custom settings. The third option is to exit the program.</p>\r\n<p class="indent1new">If the user chooses to run the simulation with default settings then each rabbit and fox will have default values as described in <b>Table 1</b> and <b>Table 2</b>. The landscape will contain five warrens and five foxes, in the positions shown in <b>Figure 1</b>.</p>\r\n<p class="graph"><b>Figure 1</b></p>\r\n<p class="graph"><img src="AA_COM/QS17L1PM_files_Q/img03.jpg"/>&nbsp;</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">If the user chooses to run the simulation with custom settings then the user can choose the size of the landscape, the initial number of foxes, the initial number of warrens and the amount of variability to build into the model. The higher the variability chosen the more difference there will be between individual rabbits and individual foxes and the more difference there will be in the number of rabbits in each warren at the start of the simulation. Individual rabbits and foxes vary in terms of their lifespan, their probability of death from other causes, their reproduction rate (rabbits only) and the amount of food they need to eat (foxes only).</p>\r\n<p class="indent1new">When the simulation is run (either using default or custom settings) the current state of the landscape is displayed and the user is shown a menu containing five options.</p>\r\n<p class="indent1new"><b>Option one</b> is to advance the simulation to the next time period showing details about the changes that have happened to each warren and each fox.</p>\r\n<p class="indent1new"><b>Option two</b> is to advance the simulation to the next time period but without showing details of the changes that have happened to the warrens and foxes.</p>\r\n<p class="indent1new"><b>Option three</b> is to inspect a fox. When this option is chosen the user will be shown the details of the fox that is at coordinates specified by the user.</p>\r\n<p class="indent1new"><b>Option four</b> is to inspect a warren. When this option is chosen the user will be shown the details of the warren that is at coordinates specified by the user. After the warren details have been displayed the user can also choose to view details about all the rabbits currently living in the warren.</p>\r\n<p class="indent1new"><b>Option five</b> is to exit the simulation. When the user chooses this option they will be taken back to the program’s main menu.</p></h5>', 'markscheme': '', 'examinerreport': '', 'notes': '', 'resources': ''}, 'QS171PM': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>CAPTURE THE SARRUM</b></p>\r\n<p class="indent1new">The <b>Skeleton Program</b> is for the board game CAPTURE THE SARRUM.</p>\r\n<p class="indent1new">CAPTURE THE SARRUM is an ancient variant of the game of chess. It is a two player game &#8211; one player has the white pieces and the other player has the black pieces. Each player takes it in tum to move one of their pieces; different pieces have different rules that determine how they can move. To win the game a player needs to take (capture) the opponent&#8217;s sarrum. The player using the white pieces always moves first.</p>\r\n<p class="indent1new"><b>Figure 1</b> shows an empty board. The board consists of an 8 &#215; 8 grid of squares. The rows are called <b>ranks</b> and the columns are called <b>files</b>. Each file is labelled with a number between one and eight and each rank is also labelled with a number between one and eight.</p>\r\n<p class="graph"><b>Figure 1</b></p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img01.png"/>&nbsp;</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">In <b>Figure 2</b> the third file has been shaded.</p>\r\n<p class="graph"><b>Figure 2</b></p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img02.png"/>&nbsp;</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">In <b>Figure 3</b> the second rank has been shaded.</p>\r\n<p class="graph"><b>Figure 3</b></p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img03.png"/>&nbsp;</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">There are six different types of piece in the game; the rules for moving each of the pieces are described in <b>Table 1</b>. If a piece moves into a square containing one of the opponent&#8217;s pieces then that piece is taken (it is removed from the board). No piece can move into a square containing another piece of the same colour.</p>\r\n<p class="graph"><b>Table 1</b></p>\r\n<p class="bottom">&nbsp;</p>\r\n<table class="data-table left1">\r\n\t<tr>\r\n\t\t<td class="col-6"><p class="padded text-left"><b>Piece name</b></p></td>\r\n\t\t<td class="col-18"><p class="padded text-left"><b>How the piece moves</b></p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-6"><p class="padded text-left">Sarrum (king)</p></td>\r\n\t\t<td class="col-18 vert-top"><p class="padded text-left">A sarrum can move one square at a time in any  direction.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-6 vert-top"><p class="padded text-left">Marzaz pani (royal attendant)</p></td>\r\n\t\t<td class="col-18 vert-top"><p class="padded text-left">A marzaz pani can move one square at a time either vertically or horizontally &#8211; it cannot make diagonal moves.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-6 vert-top"><p class="padded text-left">Nabu (seer)</p></td>\r\n\t\t<td class="col-18 vert-top"><p class="padded text-left">A nabu can move one square at a time along a diagonal &#8211; it cannot make horizontal or vertical moves.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-6 vert-top"><p class="padded text-left">Etlu (warrior)</p></td>\r\n\t\t<td class="col-18 vert-top"><p class="padded text-left">An etlu can move two squares at a time in either a vertical or horizontal line &#8211; it must move exactly two squares and it cannot make diagonal moves. An etlu can jump over other pieces.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-6 vert-top"><p class="padded text-left">Gisgigir (chariot)</p></td>\r\n\t\t<td class="col-18 vert-top"><p class="padded text-left">A gisgigir can move any number of squares at a time in either a vertical or horizontal line &#8211; it cannot make diagonal moves. A gisgigir cannot jump over other pieces.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-6 vert-top"><p class="padded text-left">Redum (soldier)</p></td>\r\n\t\t<td class="col-18 vert-top">\r\n\t\t<p class="padded text-left">A redum can move foiward one square at a time. If the square directly in front  of a redum is empty then the redum can move into that square.</p>\r\n\t\t<p class="padded text-left">If a square that is one rank in front of and directly to the left or right of a redum contains an opponent&#8217;s piece, then the redum can move into that square and will capture the piece.</p>\r\n\t\t<p class="padded text-left">If a redum reaches the back rank (the first rank for a white redum, the eighth rank for a black redum) it is promoted (changes) into a marzaz  pani.</p>\r\n\t\t\r\n\t\t</td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new"><b>Figure 4</b> shows the position of the pieces at the start of a game of CAPTURE THE SARRUM. Each piece has been represented using the first letter of its name eg <span class="comp">s</span> = sarrum. <span class="comp">A B</span> is used to indicate a black piece and <span class="comp">a W</span> indicates a white piece.</p>\r\n<p class="graph"><b>Figure 4</b></p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img04.png"/>&nbsp;</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">In <b>Figure 5</b> shaded squares in the diagrams show the legal moves that a piece can make.</p>\r\n<p class="graph"><b>Figure 5</b></p>\r\n<p class="bottom">&nbsp;</p>\r\n<table class="data-table left2">\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img05.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s sarrum <b>can</b> move one square in any direction.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><table class="data-table left2">\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img06.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s marzaz pani <b>can</b> move one square vertically or horizontally.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img07.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s marzaz pani <b>cannot</b> move to a square containing another white piece.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><table class="data-table left2">\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img08.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s nabu <b>can</b> move one square in a diagonal direction.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img09.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s etlu <b>can</b> move two squares in a vertical or horizontal direction.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><table class="data-table left2">\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img10.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s etlu <b>cannot</b> move into the same square as another white piece but <b>can</b> move into the same square as a black piece (the black piece will be captured). An etlu <b>can</b> jump over other pieces of either colour.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img11.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s gisgigir <b>can</b> move any number of squares in a straight line, either horizontally or vertically.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><table class="data-table left2">\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img12.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s gisgigir <b>cannot</b> move to a square occupied by another white piece and it <b>cannot</b> jump over other pieces.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img13.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s redum <b>can</b> move one square forward; it <b>cannot</b> move diagonally forward unless it is capturing a black piece.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><table class="data-table left2">\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img14.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s redum <b>can</b> either move one square forward or it can move diagonally forward one square to capture the black marzaz pani.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img15.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s redum <b>cannot</b> move to the square immediately in front of it as this is occupied by another piece; it <b>can</b> move diagonally forward one square to capture either the black marzaz pani or the black sarrum.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><table class="data-table left2">\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img16.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">White&#8217;s redum has no legal moves.</p></td>\r\n\t</tr>\r\n\t<tr>\r\n\t\t<td class="col-15 no-border"><p class="padded text-left"><img src="AA_COM/QS171PM_files_Q/img17.png"/>&nbsp;</p></td>\r\n\t\t<td class="col-6 no-border"><p class="padded text-left">Black&#8217;s redum <b>can</b> either move one square forward or it can capture the white etlu - it <b>cannot</b> move to the square containing the black gisgigir.</p></td>\r\n\t</tr>\r\n</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">When the Skeleton Program is run, the user is given the option to play using a sample game. If they choose to play the sample game then the initial board position will be as shown in <b>Figure 6</b>; otherwise the initial board position will be as shown in <b>Figure 4</b>.</p>\r\n<p class="graph"><b>Figure 6</b></p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img18.png"/>&nbsp;</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">When the sample game starts it is White\'s move.</p>\r\n<p class="indent1new">To enter a move the player types in the grid reference of the square containing the piece that they would like to move (the start square) and then the grid reference of the square that they would like  to move the selected piece to (the finish square). A grid reference is the number of the file followed by the number of the rank, eg in <b>Figure 6</b> the grid reference 41 indicates the position of Black\'s sarrum. If the move entered is a legal move then the board will be updated and it will now be the other player\'s turn.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new"><b>Figure 7</b>, <b>Figure 8</b> and <b>Figure 9</b> show three examples of White entering a move and the positions after these moves, from the start position shown in <b>Figure 6</b>.</p>\r\n<p class="graph"><b>Figure 7</b></p>\r\n<p class="graph">White enters a start square of 13 and a finish square of 23.</p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img19.png"/>&nbsp;</p>\r\n<p class="graph">White\'s sarrum has captured Black\'s etlu.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="graph"><b>Figure 8</b></p>\r\n<p class="graph">White enters a start square of 81 and a finish square of 41.</p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img20.png"/>&nbsp;</p>\r\n<p class="graph">White\'s gisgigir has captured Black\'s sarrum and wins the game.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="graph"><b>Figure 9</b></p>\r\n<p class="graph">White enters a start square of 12 and a finish square of  13.</p>\r\n<p class="graph m-t-0">A message saying \'That is not a legal move &ndash; please try again\' is  displayed.</p>\r\n<p class="graph m-t-0">White then enters a start square of 12 and a finish square of  21.</p>\r\n<p class="graph"><img src="AA_COM/QS171PM_files_Q/img21.png"/>&nbsp;</p>\r\n<p class="graph">White\'s redum has captured Black\'s gisgigir and White\'s redum has reached the</p>\r\n<p class="graph m-t-0">eighth rank and so is promoted to a marzaz pani.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">The game continues until one of the players captures the opponent\'s sarrum. The user is then  given the option to play another game &ndash; if they don\'t choose to play another game then this will exit the <b>Skeleton Program</b>.</p>\r\n<p class="indent1new"><b>Notes</b></p>\r\n<p class="indent1new">Your chosen programming language may use arrays with a lower bound value of <span class="comp">O</span>. If so, array ells with indices of <span class="comp">O</span> are not used.</p></h5>', 'markscheme': '', 'examinerreport': '', 'notes': '', 'resources': ''}}
User: Now, the user will ask questions after this message. Use everything I gave you and the knowledge you have acquired, and from the notes you made, to answer their question in a very concise way that WILL score ALL marks. Just like the notes. For this, your answer will not have the same structure as the revision notes. Think of it as answering an exam question: short, consice, useful, scores ALL marks. Just like the exam questions provided to you, you will not leave your response in a 'notes' manner. You are just answering an exam question: which means it has to be very short unless explicitly specified by the user that it must be long and detailed. So, keep it short, concise, and only a couple of sentences that score ALL marks. Remember, it is an A-Level exam question and you will style it as such: incredibly concise sentences (essentially like bullet points but without the bullet points) that score marks. Most sentences won't even have commas, this does not mean you can't use them. Also do not repeat the question in your answer, just do it. Score all marks, assume how many marks there are based on the question if it is not provided to you. Imagine that for every sentence you make, you score a mark (for simpler questions), for high (>5 mark) questions that may differ.
In summary, you must:
* Answer very concisely. Kind of like bullet points but as a short para. Most of the time, a sentence, or point, will be a mark.
* Do not repeat the question at the start.
* Don't over-do your answer. Please. 1 mark (e.g., usually, 'What' questions) is like one very short sentence usually. Remember the summary from the notes? Your answer will essentially be like that for most questions but a bit (a bit!) more developed. Remember, this is just A-Levels. Use some of the exam questions that I provided as an example of how you should model your answers.
* When you're listing examples, don't list every example in the universe.
* Score all marks. Be helpful.
User: Give me the notes you made
Assistant: Programming Basics** (Spec Points: 3.1.1.1, 3.1.1.2, 3.1.1.6, 3.5.1.2)  

**Introduction**  
A computer program is a list of instructions that execute a specific task. It consists of algorithms, which are step-by-step processes. Programming languages allow you to write these algorithms using defined syntax, which stipulates the structure and rules needed for writing effective code.  

**Learning Objectives**  
In this chapter, you will learn:  
- Basic programming principles  
- Constants and variables  
- Main data types  
- Data storage using meaningful names  

**Constants and Variables** (Spec Points: 3.1.1.6)  
Data is named and stored in memory, similar to pigeon-holes. For example, to add two numbers, they must be assigned meaningful names, such as Number1 and Number2. This is known as ‘assignment’. A constant has a fixed value, while a variable's value may change. Example:  
- Constant: MAX_HEIGHT = 50  
- Variable: CurrentScore = 5  

**Variable Declaration**  
Declaring a variable involves specifying a name and data type. The declaration is crucial for preventing errors during execution. For example, in Visual Basic:  
- Dim Age As Integer  
- Dim Name As String  

**Data Types** (Spec Points: 3.1.1.1)  
Understand the appropriate data types for effective data handling:  
- Integer: Whole numbers (e.g., -10, 25)  
- Real/Float: Numbers with decimals (e.g., 3.14, 2.5)  
- Text/String: Any character sequences (e.g., "Hello World")  
- Boolean: True/False values  
- Date/Time: Store date values (e.g., 2023-10-13)  
- Pointer: Reference memory locations  

**Arrays and Records**  
Arrays store multiple items of the same type, whereas records store related items of different types. Example of an array:  
- Names[0] = "Alice"  
- Names[1] = "Bob"  

**Built-in and User-defined Data Types**  
Programming languages provide built-in data types, while developers can create user-defined types by combining existing types. This aids in code organization and efficiency.

---

**Summary**  
1. Programs execute through algorithms written in various programming languages with specific syntax.  
2. Data can be assigned as constants or variables, with variables allowing change during execution.  
3. Proper declaration and use of data types are critical for effective programming.  
4. Arrays and records enhance data management in programs while supporting both built-in and user-defined data types.

---

{
  "chapter": 1,
  "page": 1,
  "chapter_name": "Programming Basics",
  "topics": [
    "Introduction",
    "Constants and Variables",
    "Variable Declaration",
    "Data Types",
    "Arrays and Records",
    "Built-in and User-defined Data Types"
  ]
}
User: Include all definitions
Assistant: