section 2-prgramming Flashcards Preview

GCSE AQA Computer science > section 2-prgramming > Flashcards

Flashcards in section 2-prgramming Deck (37)
Loading flashcards...
1

languages

languages have functions that manually convert between data types (e.g string_to_int)

2

data types

integer = whole numbers only
real(float) =numbers with decimals
boolean = true or false values
character = a single letter,number,symbol...
string = represents texts

3

operations

+ addition - subtraction
*multiplication / division
div= whole number mod=remainder

4

assignment operator

the assignment operator arrow or = is used to assign values to to a variable

5

comparison operators

are things like equal to ,greater than....

6

data values

data values can be stores as constants or variables ,
constants and variables need to be declared before use

7

constants

a constant is assigned to a value at design time

8

variables

a variable on the other hand can be changed which therefore makes them more useful

9

strings

strings are a data type made up of characters ,when manipulating strings you start at 0

10

inputs

inputs can be received from many devices (keyboards ,mouses,webcam....)

11

outputs

outputs are typically displayed (monitors)

12

if statements

if statements allow you to check if a condition is true or false.
more complex if statements can be made by putting one if statement inside another one

13

else if statements

else if statements are used to check multiple conditions and if they give out different outputs

14

case statements

case statements can check is a variable have specific values

15

repeat until loop

controlled by a condition or until a condition is true, you get an infinite loop if the condition is never true.
(same as ado until loop)

16

while loops

while loops keep going while the condition is true .while loops are controlled by a condition at the start of the loop

17

do-while loops

controlled by end of the loop.keep while if the condition is true

18

for loops

for loops will repeat the code inside a fixed number of times.for loops are a type of definite iteration

19

nested iteration

is typically having a loop inside another

20

boolean operators

look in revisions guide!!!

21

generating random numbers

random.int()

22

random numbers

random numbers generate random selections(e.g stimulate a coin toss)

23

using LEN()

the number of elements in an array can be found using the LEN() just like for strings

24

arrays

arrays are a data structure that can store a group of data values of the came type ,under one name

25

one-dimensional arrays

one-dimensional arrays are like lists
e.g creating arrays changing elements
retrieving elements number of elements

26

creating arrays

start of with array name,assign and operator and putting data in [] with commas separating it

27

retrieving elements

retrieving elements can be done by using the name of the array and elements position(starting at 0 not 1)

28

changing elements

changing elements is done by reassigning the array position to a different data value

29

two-dimensional arrays

two-dimensional arrays are like one-dimensional arrays where each element is also one dimensional arrays,you can change element the exact same way (using LEN())

30

record

a record is a type of data structure like an array,it is used to store data,records can keep related info in one place