Week 1 - Ruby Introduction Flashcards

1
Q

Keywords

A

Words which have specific meaning or complete a special function in a programming language.

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

def

A

Used to define a method

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

end

A

Closes off the defintion of a method

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

What does calling a method mean?

A

Executes the method (things between def and end)

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

print

A

Prints a string of data, and doesn’t add a new line after executing.

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

puts

A

Prints a string of data, and adds a new line after executing.

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

gets

A

Requests a string of data to be used. (Enter your name here: )

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

String

A

A line of characters stored within quotations “…”

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

Integers

A

Whole numbers

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

Real/Float

A

Floating decimal point numbers

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

Booleans

A

True or false

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

Variables

A

A piece of data that we declare and is part of the computer’s memory which can be called on later.

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

Constant

A

A given value which will never change throughout the code

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

+ Signs

A

They are based on the context of data.

Can represent addition if there are integers.

Can also represent putting 2 strings together if strings.

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

Logic Error

A

An error made often due to typos

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

Syntax Error

A

An error made due to not following the rules of the programming language.

Eg: not including ‘ ‘ for print

17
Q

Global Variable

A

A variable declared outside of a method, meaning that it can be called in any method.

18
Q

Local Variable

A

A variable declared inside of a method (between def and end) and can only be used inside of that method.

19
Q

Compiler

A

The program which runs the code

20
Q

gets.chomp

A

Removes (chomps) any white space when requesting a string of info.

21
Q

Pseudocode

A

Using the English language to explain what you want the code to do.

22
Q

Statements

A

Just lines of code

23
Q

Expression

A

Anything that can be evaluated to give a value.

Eg: 5+2 = 7, ‘Hello’ + ‘World’ = Hello World