Computer Science : Programming 3.2

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

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:18 PM on 5/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

25 Terms

1
New cards

What is a ‘data type’?

Each variable has a data type.

It determines what kind of cake the variable will hold and the set of operations that can be performed with it.

2
New cards

What is an integer?

A whole number.

3
New cards

What is a Real/Float?

Numbers that can include fractions/values after the decimal point.

4
New cards

What is a character?

Stores a single character in a fixed-length formal related to a specific character set (e.g ASCII).

5
New cards

What is Boolean?

A data type that can represent two values like True and False.

6
New cards

What is a string?

A sequence of characters.

7
New cards

What is a variable?

An identifier than represents a memory location that can store a value.

This value can change during the execution of a program.

8
New cards

What is a constant?duri

An identifier that represents a memory location that can store a value.

This value cannot change during the execution of a program.

9
New cards

What is an array?

A data structure that stores a collection of elements of the same data type under a single variable name and is accessed through an index.

10
New cards

What is the difference between a constant and a variable?

A constant had a value that cannot change, while a variable has a value that can change.

11
New cards

What is an assignment?

An assignment statement sets the value of a variable/constant.

12
New cards

What is iteration?

The repetition of a block of code.

13
New cards

Why is testing important for programmers?

It helps them remove bugs from the software and ensure that it works correctly.

14
New cards

What is the difference between definite and indefinite iteration?

Definite iteration is used when you know how many times the loop should run.

But indefinite iteration is used when you don’t know how many times the loop should run, but you know when it should stop.

15
New cards

What is the difference between indefinite and definite iteration loop types?

Indefinite loop type: condition controlled (e.g., WHILE loop).

Definite loop type: count controlled (e.g., FOR loop)

16
New cards

What is the use case for definite iteration in programming?

Processing a fixed size list.

(e.g., Calculating the average score of 30 students → number of iterations is known from the start (30)).

17
New cards

What is the use case for indefinite iteration in programming?

Reading input until a condition is met.

(e.g., A number guessing game where the user guesses a secret number → number of guesses is unknown, depends if the user guesses correctly.))

18
New cards

What does a selection statement allow?

Allows a block of code to be executed only when a certain condition is satisfied.

19
New cards

List examples of a selection statement:

IF, THEN, ELSE, SWITCH/CASE/MATCH

20
New cards

What is a subroutine?

A named ‘out of line’ block of code that may be executed by simply writing its name in a program statement. It can be reused multiple times within a program.

21
New cards

What are parameters?

Variables which define the data to be passed into a subroutine when the subroutine is called.

22
New cards

What are local variables?

  • Declared within a subroutine.

  • Exist only while a subroutine is executing.

  • Are accessible only from within the subroutine.

23
New cards

What is a validation routine?

A routine that contains code to check the validity of data.

Validity of data refers to data being reasonable. Might involve range checks, length checks and presence checks.

24
New cards

What is an authentication routine?

A routine that contains code that verifies an identity.

Such as the entry of a username and password.

Ifi

25
New cards

What are types of testing data?