Comp science princples Flashcards
learn what it is
What is a Algorithm?
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.
what command makes turtle move forward?
painter.forward(d)
what command makes turtle move backward?
painter.backward(d)
what command makes turtle move right?
painter.right(a)
what command makes turtle move left?
painter.left(a)
what command makes turtle draw a circle?
painter.circle(r)
what command makes turtle move anywhere in the x,y coordinates?
painter.goto(x,y)
what command Sets the direction the turtle is facing to a give value h, where h is a value between 0 and 360?
painter.setheading(h)
what command Changes the color of the drawing pen where c is the name of a color such as “red”, “blue”, and “yellow.”?
painter.pencolor(c)
what command Places the pen back on the canvas so you can resume drawing (note there is no parameter/value for this method)?
painter.pendown()
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)?
painter.penup()
what command Set the pen size to s?
painter.pensize(s)
what command Set the size of the turtle to s?
painter.turtlesize(s)
What does user input mean?
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.”)
What is a advance way you can make a circle?
painter.forward(30)
painter.right(20)
While Loops
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.
For Loops
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.
Nested Loops
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.
Modulo operator
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.
Order of operations
Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction.
Well named variables
Use descriptive names that convey the purpose, meaning, or role of the variable.
Lists
An ordered collection of items or values.
If/else statements
A feature of a programming language that performs different computations or actions depending on whether a Boolean condition evaluates to true or false.
Functions
a block of statements that return the specific task.
On Key press
a command that only works when a certain keybind is pressed
Pseudocode
a way of expressing an algorithm without conforming to specific syntax rules.
Phishing / malicious content
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.
Password encryption
The process of encoding data to prevent unauthorized access, such as converting plaintext to ciphertext.
What are some ways you can create a strong password
adding symbols and captialize certain letters, not using the same password you have for other places, not using personal info in your password
User Interface
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.
GUI Widgets
the basic building blocks for graphical user interface (GUI) applications built with Qt