Programming Fundamentals and Data Types (1)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:19 PM on 4/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

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
New cards

Define constant.

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

3
New cards

What is assignment?

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

4
New cards

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
New cards

State four arithmetic operators

Arithmetic operators include: +, -, *, / %, //, ** MOD, DIV, ^

6
New cards

State two comparison operators

Comparison operators include: == != < >

7
New cards

Define input.

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

8
New cards

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
New cards

What is an output?

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

10
New cards

Typical output devices include?

Typical output devices include: monitor speaker printer.

11
New cards

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
New cards

The three core programming constructs are?

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

13
New cards

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
New cards

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
New cards

Two ways to write selection statements are?

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

16
New cards

Define iteration.

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

17
New cards

State two types of Iteration.

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

18
New cards

The keywords indicating selection are?

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

19
New cards

The keywords indicating iteration are?

The keywords indicating iteration are for, while, do.

20
New cards

If no selection or iteration keywords, the construct is?

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

21
New cards

State the output of 10 MOD 3?

10 MOD 3 = 1

22
New cards

State the output of 10 DIV 3?

10 DIV 3 = 3

23
New cards

State the output of 2 ^ 3?

2 ^ 3 = 8

24
New cards

State the output of 15 % 4?

15 % 4 = 3

25
New cards

State the output of 10 // 2?

10 // 2 = 5

26
New cards

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
New cards

What is a data type?

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

28
New cards

Integer

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

29
New cards

Real

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

30
New cards

Character

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

31
New cards

String

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

32
New cards

Boolean

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

33
New cards

What is casting?

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

34
New cards

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

True. Casting changes the data type within a program.

35
New cards

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

real_value = float(X)

36
New cards

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

int_value = int(X)

37
New cards

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

str_value = str(X)

Explore top flashcards

flashcards
Semester 1 midterms science
21
Updated 108d ago
0.0(0)
flashcards
Prep Game Notes
31
Updated 435d ago
0.0(0)
flashcards
Gr 11 Bio - Evolution
54
Updated 1081d ago
0.0(0)
flashcards
SIS 342 FINAL EXAM
72
Updated 344d ago
0.0(0)
flashcards
Bio - Exam intra 1
108
Updated 550d ago
0.0(0)
flashcards
Welding Test. Airframe
35
Updated 479d ago
0.0(0)
flashcards
Semester 1 midterms science
21
Updated 108d ago
0.0(0)
flashcards
Prep Game Notes
31
Updated 435d ago
0.0(0)
flashcards
Gr 11 Bio - Evolution
54
Updated 1081d ago
0.0(0)
flashcards
SIS 342 FINAL EXAM
72
Updated 344d ago
0.0(0)
flashcards
Bio - Exam intra 1
108
Updated 550d ago
0.0(0)
flashcards
Welding Test. Airframe
35
Updated 479d ago
0.0(0)