Review day1 Flashcards

(23 cards)

1
Q

Pseudocode

A

A way to plan a program’s logic before writing actual code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

if statement

A

IF condition THEN
sequence 1
ELSE
sequence 2
ENDIF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

while loop

A

WHILE condition
sequence
ENDWHILE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

for loop

A

FOR iteration bounds
sequence
ENDFOR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Pseudocode Example 1:
Find the Maximum Number

A

START
SET max to first element of the list
FOR each element in the list
IF the element is greater than max
SET max to the element
END IF
END FOR
RETURN max
END

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Pseudocode Example 2:
Find the sum

A

START
SET sum to 0
FOR each number in the list
ADD number to sum
END FOR
RETURN sum
END

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Computational thinking Principles

A

Decomposition, pattern recognition, abstraction and algorithmic thinking.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Decomposition

A

Breaking down complex problems into smaller parts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Pattern Recognition

A

Identifying similarities and differences between problems and solutions, and using this knowledge to generalize solutions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Abstraction

A

Focusing on the important details and ignoring irrelevant information, creating a simplified model of the problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Algorithms

A

Developing a step-by-step set of instructions to solve the problem .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Analyzing code

A

Examine the code to identify issues such as bugs. Fix the problem, then test it again

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Nature of programming languages (Java)

A

Java is a high-level, object-oriented, class-based, general-purpose, and platform-independent programming language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Object-Oriented

A

Java is built around the concept of objects, which encapsulate both data and behavior. This promotes code reusability, modularity, and maintainability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Class-Based

A

Java uses classes as blueprints for creating objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

General-Purpose

A

Java can be used to develop a wide variety of applications, from simple scripts to complex enterprise systems.

17
Q

Platform-Independent

A

Java code can run on any platform that supports the Java Virtual Machine (JVM).

18
Q

Recursion

A

A function calls itself

19
Q

Three main parts of Recursion

A

1.Base case
2. Recursive case
3. A change of state that moves the function closer to the base case

20
Q

Base case

A

This is the condition that stops the recursion

21
Q

Recursive Case

A

The function calls itself with a slightly modified version of the input

22
Q

Change of State

A

This ensures that each recursive call brings the function closer to the base case.

23
Q

Recursion Example 1:
Calculate the sum from 1 to n

A

public static int sum(int n)
{
if (n == 1)
{
return 1;
}
return n + sum(n - 1);
}