CS50 Flashcards

1
Q

Computers really only understand what?

A

Zero’s and Ones

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

What is binary system

A

Zero’s and Ones

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

Computers’ use powers of what?

A

Powers of 2

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

How is a “1” represented in computer value?

A

001

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

How is a “2” represented in computer value?

A

010

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

How is a “3” represented in computer value?

A

011

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

How is a “4” represented in computer value?

A

100

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

Zeros and ones– the so-called binary system–

are what a computer scientist would generally call what?

A

a bit, or binary digit.

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

Inside of a computer is millions,
billions of things that are just smaller than that, called,
_____ or switches, that you just turn on and off.

A

transistors

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

How many “bits” equal a “byte?”

A

8 bits equal one byte

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

Unicode allowed us to represent what new thing with zero’s and one’s?

A

Color

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

What is an algorithm?

A

step by step instructions

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

What is another term for “actions?”

A

Functions

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

What are “conditions”

A

Actions points for a decision

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

What is a Boolean expression?

A

Something that is either true or false, yes or no

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

What is the goal of an algorithm?

A

Finding “good” and “fast” solutions to problems

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

Math inequalities are really _____ expressions.

A

Boolean

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

What is an array?

A

A list, or way of storing multiple pieces of information in a variable, not just a number.

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

Multi-threading allows me to do…..

A

multiple things at a time

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

The goal in programming is…

A

to take very deliberate baby steps toward end goal

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

Scratch website?

A

Scratch.MIT.edu

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

A multi-threaded program is a program that can do….

A

multiple things at once.

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

0 and 1 represent what?

A

False (0) and True (1)

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

What does “PRINTF” stand for?

A

Print Formatted or

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

In printf(“hello, world\n”); what does printf represent?

A

FUNCTION or activity for the computer to perform (SAY)

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

In printf(“hello, world\n”); what does HELLO WORLD represent?

A

The computer’s parameter, argument, or customization.

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

In printf(“hello, world\n”); what does the \n represent?

A

Moving the cursor of computer to the next line…kind of like hitting the ENTER key on keyboard

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

What does “true” represent in computer language?

A

It represents ON or 1.

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

How would I create a forever loop of saying “hello, world”?

A

while (true)
{
printf(“hello, world\n”);
}

The WHILE (TRUE) will cause the action to be looped forever.

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

Why type of loop can I write in C if I want a action to be repeated only a certain number of times then stop?

A

I should write a “for” loop.

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

What is the syntax of a “for loop” in C programming language?

A

for ( init; condition; increment ) {
statement(s);
}

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

Programmers almost always start counting from what number?

A

Zero

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

What does “int” stand for in C programming?

A

Integer (whole number; a number that is not a fraction)

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

A variable is nothing but a name given to a _____ area that our programs can manipulate.

A

storage

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

Each variable in C has a specific type, which determines what?

A
  1. the size and layout of the variable’s memory
  2. the range of values that can be stored within that memory
  3. the set of operations that can be applied to the variable.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

The name of a variable can be composed of what?

A
  1. letters
  2. digits
  3. underscore character
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

The name of variables must begin with what?

A

either a letter or an underscore.

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

Is C programing language case sensitive?

A

Yes

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

What are the 5 basic variable types in C Programming?

A
  1. char
  2. int
  3. float
  4. double
  5. void
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What does the semi-colon ; mean in C Programming?

A

it is the end of thought

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

What is the “less than” symbol?

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

What is the “greater than” symbol?

A

>

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

What is a condition?

A

A statement that tells the computer if this then do that.

44
Q

Example of CONDITIONAL STATEMENT?

A
if (x < y)
{
printf {"x is less than y\n" };
}
else (x > y)
{
printf {"x is greater than y\n" };
}
else
{
printf {"x is equal to y\n" };
}
45
Q

What is an ARRAY?

A

A special type of variable (or list) that allows for the storage of data back to back, to back, to back.

46
Q

What does “argv” stand for in C programming?

A

Argument Vector which is my designated ARRAY or list name.

47
Q

What does “main” stand for in C programming?

A

It is a special default FUNCTION which refers to the main piece of code that gets executed automatically when a program is run.

48
Q

What does CPU stand for?

A

Central Processing Unit

49
Q

What does CPU represent?

A

Brain of computer

50
Q

An _____ _____ has designated that certain patterns of 0’s and 1’s shall mean certain things.

A

Intel brain (CPU)

51
Q

What are the software programs which convert/translate source code into machine code known as?

52
Q

C is a language that is usually _____ or converted from source code to machine code.

53
Q

If I want to translate the source code I have written into machine code (0’s and 1’s) I have to do what first?

A

Feed my source code into the machine as INPUT through a special program called a COMPILER.

54
Q

A COMPILER has a set of _____ that know how to convert special keywords like main, printf, etc into machine code patters of 0’s and 1’s so the CPU can understand.

A

algorithms

55
Q

What are 2 examples of programs that do not run on my computer but, rather, on the cloud?

A

Python

JavaScript

56
Q

What does IDe stand for?

A

Integrated Development

57
Q

What is IDe?

A

Web-based programming environment that is built on top of open source software called Cloud9

58
Q

What is the CS50 cloud based environment known as?

A

CS50 IDE

located at cs50.io

59
Q

What does pedagogical mean?

A

related to teaching

60
Q

Any program I write that’s written in the C language

should be named something _____ _____, by convention.

A

dot c or .c

example:
hello.c

61
Q

In the environment of CS50 IDE, one is using

an operating system called _____.

62
Q

Linux is reminiscent of another operating system, generally known as _____.

63
Q

Linux is particularly known for having what type of environment?

A

Command Line Environment, CLI.

64
Q

What does CLI stand for?

A

Command Line Environment

65
Q

What “flavor” of Linux is CS50 IDE using?

A

Ubuntu which is just a version of Linux

66
Q

What is “clang” in the C Language?

A

a COMPILER which is pre-installed in CS50 IDE

67
Q

What is the $ mean in the command line?

A

A convention or PROMPT that means type your commands here.

68
Q

The default name for programs when you don’t specify a name for your program is just _____.

69
Q

Dot slash of ./a.out just means what?

A

Hey, CS50 IDE, run a program called a.out

that’s inside my current directory.

70
Q

What does the dot of ./a.out mean?

A

Current directory

71
Q

The less that happens on your computer screen, the more likely your code is _____, at least syntactically.

72
Q

What is “clang” short for?

A

C Language

73
Q

A computer is literally going to do what?

A

Only what I tell it to do

74
Q

Whenever I change my source code I have to do what in order to allow my computer to read the change?

A

Run my change through the compiler again.

75
Q

What does a.out stand for?

A

Assembly Output

76
Q

What are other terms for command line arguments?

A

Flags

Switches

77
Q

What do command line arguments (flags or switches) influence?

A

The behavior of a program

78
Q

What does -o represent?

A

Output

It is an output command line argument or flag that creates a new folder other than a.out (default)

79
Q

Example of creating a new folder in command line?

A

clang -o name hello.c

80
Q

What does “ls” command do?

A

Lists the files in the current working directory

81
Q

What does rm stand for?

A

remove command

82
Q

The rm (i.e., remove) command is used to _____ files and directories

83
Q

What does the asterisk * mean in the command line?

A

That’s an executable, or runnable program, that one can run by doing dot slash, and then it’s name.

84
Q

How do I create a new source file in the current working directory with the MAKE program?

A

simply type in the command line: make filename

85
Q

Do I need to include the -o or .c to create a new source folder in the command line with the MAKE program?

A

No, because MAKE automatically assumes that the new file is going to be made from a source code file ending in .c or hello.c

86
Q

Is MAKE a compiler program?

87
Q

MAKE is a a convenience program that knows how to trigger a _____ to run so that one can use it.

88
Q

What does “cd” command stand for?

A

change directory

89
Q

What allows one to move forward, backwards, and open up different folders within the command line interface
without using a mouse?

A

cd (change directory) command

90
Q

What does “mkdir” mean?

A

make directory

91
Q

What does “mkdir” command do?

A

Makes a new directory (folder)

92
Q

What does “rm” stand for?

93
Q

What does “rmdir” stand for?

A

remove directory

94
Q

In stdio.h what does the io mean?

A
i = Input 
o = output
95
Q

include command enables us to use what?

96
Q

printf produces what?

97
Q

In order to use printf what line MUST I have at the top of my code?

A

include because it enables output

98
Q

In any C program I write I have to start the code with what?

A
int main (void)
{

}

99
Q

Strings are like _____.

A

sentences or sequence of characters

100
Q

What is the C command to get a string from the user?

A

get_string()

101
Q

When I do not want to provide specific input into a puzzle piece or a function how would I write its string?

A

With empty open and closed parenthesis.

102
Q

When I call get_string (), where would I place the return value results?

A

In C I would use a VARIABLE to store the get_string() return value results.

103
Q

What does the equal sign = mean in C?

A

It is the “assignment operator” which tells the computer to move a value from the right side to the left side.

104
Q

What does this mean to the computer:
{
string name = get_string();
}

A

Hey, computer, give me a string (a sequence of characters) with no inputs and call that string “Name.”

105
Q

What special syntax would I use to have a “placeholder?”