Comp science princples Flashcards

learn what it is

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a Algorithm?

A

An algorithm is a set of clear steps to complete a task. It can be written in different ways, like natural language, pseudocode, or flowcharts. Algorithms are important because they tell computers and programs what to do with data.

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

what command makes turtle move forward?

A

painter.forward(d)

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

what command makes turtle move backward?

A

painter.backward(d)

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

what command makes turtle move right?

A

painter.right(a)

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

what command makes turtle move left?

A

painter.left(a)

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

what command makes turtle draw a circle?

A

painter.circle(r)

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

what command makes turtle move anywhere in the x,y coordinates?

A

painter.goto(x,y)

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

what command Sets the direction the turtle is facing to a give value h, where h is a value between 0 and 360?

A

painter.setheading(h)

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

what command Changes the color of the drawing pen where c is the name of a color such as “red”, “blue”, and “yellow.”?

A

painter.pencolor(c)

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

what command Places the pen back on the canvas so you can resume drawing (note there is no parameter/value for this method)?

A

painter.pendown()

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

what command Lifts the pen off the canvas so you can then move the turtle to another position without making a line on the canvas (note there is no parameter/value for this method)?

A

painter.penup()

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

what command Set the pen size to s?

A

painter.pensize(s)

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

what command Set the size of the turtle to s?

A

painter.turtlesize(s)

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

What does user input mean?

A

User input in computer science refers to any data or information that a user provides to a computer or program. This input can be given through various devices like a keyboard, mouse, touch screen, or voice commands, and it allows the user to interact with the system or influence its behavior.
ex:user_name = input(“What is your name?”)
print(“Hello”, user_name, “welcome to my program.”)

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

What is a advance way you can make a circle?

A

painter.forward(30)
painter.right(20)

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

While Loops

A

a control flow statement that allows code to be executed repeatedly based on a given condition. The loop continues to execute the block of code as long as the condition remains true. Once the condition becomes false, the loop terminates.

16
Q

For Loops

A

used to iterate over a sequence (like a list, tuple, or string) or other iterable objects. Iterating over a sequence means going through each element one by one.

17
Q

Nested Loops

A

one or more loops within the body of another loop. The two loops are referred to as outer loop and inner loop. The outer loop controls the number of the inner loop’s full execution. More than one inner loop can exist in a nested loop.

18
Q

Modulo operator

A

is a way to determine the remainder of a division operation. Instead of returning the result of the division, the modulo operation returns the whole number remainder.

19
Q

Order of operations

A

Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction.

20
Q

Well named variables

A

Use descriptive names that convey the purpose, meaning, or role of the variable.

21
Q

Lists

A

An ordered collection of items or values.

22
Q

If/else statements

A

A feature of a programming language that performs different computations or actions depending on whether a Boolean condition evaluates to true or false.

23
Q

Functions

A

a block of statements that return the specific task.

24
Q

On Key press

A

a command that only works when a certain keybind is pressed

25
Q

Pseudocode

A

a way of expressing an algorithm without conforming to specific syntax rules.

26
Q

Phishing / malicious content

A

Practice of sending fraudulent emails that appear to be from legitimate companies with the intent to induce people to share sensitive information, such as passwords and credit card numbers.

27
Q

Password encryption

A

The process of encoding data to prevent unauthorized access, such as converting plaintext to ciphertext.

28
Q

What are some ways you can create a strong password

A

adding symbols and captialize certain letters, not using the same password you have for other places, not using personal info in your password

29
Q

User Interface

A

An interface defines a contract between a class and its users. It specifies a set of methods that a class must implement in order to be considered compatible with the interface.

30
Q

GUI Widgets

A

the basic building blocks for graphical user interface (GUI) applications built with Qt