programing logic 1

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

What is the purpose of an identifier in programming?

To reference a program component such as a stored value, method, interface, or class by assigning a custom-named label.

2
New cards

What are the two types of data values that an identifier can store?

A constant or a variable.

3
New cards

What is a constant in programming?

A data item whose value does not change within a program, such as the mathematical value of Pi or a player's name.

4
New cards

What are named constants?

Constants that are assigned a meaningful name to refer to a fixed value in a program.

5
New cards

What are the benefits of using constants in programming?

They improve code readability and allow for easier updates if the value changes.

6
New cards

What is a variable in programming?

An identifier whose value can change during the program's execution, such as user input or game scores.

7
New cards

What types of data can variables store?

Strings of text, numerical values, or any other type of data.

8
New cards

What is the disadvantage of not using variables in programming?

You would need to hard code all names and values, which is not considered best practice.

9
New cards

What are containers in programming?

Special identifiers that can reference multiple elements, making it more efficient than creating individual variables.

10
New cards

What are the two types of containers used to specify multiple elements?

Arrays and vectors.

11
New cards

What is an array?

A container that stores a fixed number of elements of the same type in sequential order, starting from index zero.

12
New cards

How do you declare an array?

Specify the data type, then the name of the array, followed by the maximum size in square braces.

13
New cards

What is a vector in programming?

A dynamic container that can automatically resize itself as elements are added or removed.

14
New cards

What is the main difference between arrays and vectors?

Arrays have a fixed size, while vectors have a dynamic size.

15
New cards

Why do vectors take up more memory than arrays?

Because they are dynamic and not stored in sequential memory locations, which can slow down access times.

16
New cards

What is the syntax for declaring a vector?

Specify the container type first, then the data type in angle brackets, followed by the name of the vector.

17
New cards

What is the index starting point for arrays?

Zero.

18
New cards

What happens to the size of a vector when elements are added or removed?

The size of the vector automatically adjusts.

19
New cards

What is a key takeaway from the video on programming concepts?

Identifiers can be constants or variables, arrays have fixed sizes, and vectors have dynamic sizes.