凹凸雅思
首页闪卡复习GCSECOMPUTER-SCIENCE8 programming fundamentals

programming fundamentals and data types

使用闪卡高效复习COMPUTER-SCIENCE科目知识点

共计闪卡

37

闪卡自测

进度: 1 / 37已掌握: 0 | 需要复习: 0
问题

What is a variable?

点击查看答案
请先阅读问题,然后点击卡片查看答案

所有闪卡

闪卡 1

问题

What is a variable?

查看答案

答案

A variable is a named memory location that holds data that during the execution of a program, the data can change.

闪卡 2

问题

Define constant.

查看答案

答案

A constant is fixed data that during the execution of a program cannot change.

闪卡 3

问题

What is assignment?

查看答案

答案

Assignment is the process of storing data in a variable or constant under a descriptive name. E.g. name = "SME"

闪卡 4

问题

What is an operator?

查看答案

答案

An operator is a symbol used to instruct a computer to perform a specific operation on one or more values. E.g. arithmetic, comparison

闪卡 5

问题

State four arithmetic operators

查看答案

答案

Arithmetic operators include:

闪卡 6

问题

State two comparison operators

查看答案

答案

Comparison operators include:

闪卡 7

问题

Define input.

查看答案

答案

An input is a value that is read from an input device and then processed by a computer program.

闪卡 8

问题

True or False? Without inputs, programs are useful.

查看答案

答案

False. Without inputs, programs are not useful as they can't interact with the outside world and always produce the same result.

闪卡 9

问题

What is an output?

查看答案

答案

An output is a value sent to an output device from a computer program.

闪卡 10

问题

Typical output devices include?

查看答案

答案

Typical output devices include:

闪卡 11

问题

What is a programming construct?

查看答案

答案

A programming construct determines the order in which lines of code are executed and controls the logic and behaviour of code.

闪卡 12

问题

The three core programming constructs are?

查看答案

答案

The three core programming constructs are sequence, selection, and iteration.

闪卡 13

问题

Define sequence.

查看答案

答案

Sequence refers to lines of code which are run one line at a time in the order they are written from first to last.

闪卡 14

问题

What is selection?

查看答案

答案

Selection is when the flow of a program is changed depending on a set of conditions, determining which lines or block of code runs next.

闪卡 15

问题

Two ways to write selection statements are?

查看答案

答案

Two ways to write selection statements are: if...then...else statements and case/switch statements.

闪卡 16

问题

Define iteration.

查看答案

答案

Iteration is repeating a line or block of code using a loop.

闪卡 17

问题

State two types of Iteration.

查看答案

答案

Iteration can be count controlled (e.g. for loop) or condition controlled (e.g. while loop).

闪卡 18

问题

The keywords indicating selection are?

查看答案

答案

The keywords indicating selection are if, elseif, else, endif, switch, case.

闪卡 19

问题

The keywords indicating iteration are?

查看答案

答案

The keywords indicating iteration are for, while, do.

闪卡 20

问题

If no selection or iteration keywords, the construct is?

查看答案

答案

If no selection or iteration keywords are present, the construct is sequence.

闪卡 21

问题

State the output of 10 MOD 3?

查看答案

答案

10 MOD 3 = 1

闪卡 22

问题

State the output of 10 DIV 3?

查看答案

答案

10 DIV 3 = 3

闪卡 23

问题

State the output of 2 ^ 3?

查看答案

答案

2 ^ 3 = 8

闪卡 24

问题

State the output of 15 % 4?

查看答案

答案

15 % 4 = 3

闪卡 25

问题

State the output of 10 // 2?

查看答案

答案

10 // 2 = 5

闪卡 26

问题

True or False? A data type classifies data into groups according to the kind of data they represent.

查看答案

答案

True. A data type classifies data into groups according to the kind of data they represent.

闪卡 27

问题

What is a data type?

查看答案

答案

A data type is a classification of data into groups according to the kind of data they represent.

闪卡 28

问题

Integer

查看答案

答案

An integer is a data type used for whole numbers like 10, -5, 0.

闪卡 29

问题

Real

查看答案

答案

A real is a data type used for numbers with a fractional part like 3.14, -2.5, 0.0.

闪卡 30

问题

Character

查看答案

答案

A character is a data type used for single characters like 'a', 'B', '6', '£'.

闪卡 31

问题

String

查看答案

答案

A string is a data type used for a sequence of characters like "Hello world", "ABC", "@#!%".

闪卡 32

问题

Boolean

查看答案

答案

A Boolean is a data type used for true or false values like True, False.

闪卡 33

问题

What is casting?

查看答案

答案

Casting is when you convert one data type to another data type.

闪卡 34

问题

True or False? Casting changes the data type within a program.

查看答案

答案

True. Casting changes the data type within a program.

闪卡 35

问题

State the Python code to cast an integer to a real. The identifier for the variable is X.

查看答案

答案

real_value = float(X)

闪卡 36

问题

State the Python code to cast a real to an integer. The identifier for the variable is X.

查看答案

答案

int_value = int(X)

闪卡 37

问题

State the Python code to cast a Boolean to a string. The identifier for the variable is X.

查看答案

答案

str_value = str(X)