CS50 Flashcards
Computers really only understand what?
Zero’s and Ones
What is binary system
Zero’s and Ones
Computers’ use powers of what?
Powers of 2
How is a “1” represented in computer value?
001
How is a “2” represented in computer value?
010
How is a “3” represented in computer value?
011
How is a “4” represented in computer value?
100
Zeros and ones– the so-called binary system–
are what a computer scientist would generally call what?
a bit, or binary digit.
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.
transistors
How many “bits” equal a “byte?”
8 bits equal one byte
Unicode allowed us to represent what new thing with zero’s and one’s?
Color
What is an algorithm?
step by step instructions
What is another term for “actions?”
Functions
What are “conditions”
Actions points for a decision
What is a Boolean expression?
Something that is either true or false, yes or no
What is the goal of an algorithm?
Finding “good” and “fast” solutions to problems
Math inequalities are really _____ expressions.
Boolean
What is an array?
A list, or way of storing multiple pieces of information in a variable, not just a number.
Multi-threading allows me to do…..
multiple things at a time
The goal in programming is…
to take very deliberate baby steps toward end goal
Scratch website?
Scratch.MIT.edu
A multi-threaded program is a program that can do….
multiple things at once.
0 and 1 represent what?
False (0) and True (1)
What does “PRINTF” stand for?
Print Formatted or
In printf(“hello, world\n”); what does printf represent?
FUNCTION or activity for the computer to perform (SAY)
In printf(“hello, world\n”); what does HELLO WORLD represent?
The computer’s parameter, argument, or customization.
In printf(“hello, world\n”); what does the \n represent?
Moving the cursor of computer to the next line…kind of like hitting the ENTER key on keyboard
What does “true” represent in computer language?
It represents ON or 1.
How would I create a forever loop of saying “hello, world”?
while (true)
{
printf(“hello, world\n”);
}
The WHILE (TRUE) will cause the action to be looped forever.
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?
I should write a “for” loop.
What is the syntax of a “for loop” in C programming language?
for ( init; condition; increment ) {
statement(s);
}
Programmers almost always start counting from what number?
Zero
What does “int” stand for in C programming?
Integer (whole number; a number that is not a fraction)
A variable is nothing but a name given to a _____ area that our programs can manipulate.
storage
Each variable in C has a specific type, which determines what?
- the size and layout of the variable’s memory
- the range of values that can be stored within that memory
- the set of operations that can be applied to the variable.
The name of a variable can be composed of what?
- letters
- digits
- underscore character
The name of variables must begin with what?
either a letter or an underscore.
Is C programing language case sensitive?
Yes
What are the 5 basic variable types in C Programming?
- char
- int
- float
- double
- void
What does the semi-colon ; mean in C Programming?
it is the end of thought
What is the “less than” symbol?
What is the “greater than” symbol?
>
What is a condition?
A statement that tells the computer if this then do that.
Example of CONDITIONAL STATEMENT?
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" }; }
What is an ARRAY?
A special type of variable (or list) that allows for the storage of data back to back, to back, to back.
What does “argv” stand for in C programming?
Argument Vector which is my designated ARRAY or list name.
What does “main” stand for in C programming?
It is a special default FUNCTION which refers to the main piece of code that gets executed automatically when a program is run.
What does CPU stand for?
Central Processing Unit
What does CPU represent?
Brain of computer
An _____ _____ has designated that certain patterns of 0’s and 1’s shall mean certain things.
Intel brain (CPU)
What are the software programs which convert/translate source code into machine code known as?
COMPILERS
C is a language that is usually _____ or converted from source code to machine code.
COMPILED
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?
Feed my source code into the machine as INPUT through a special program called a COMPILER.
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.
algorithms
What are 2 examples of programs that do not run on my computer but, rather, on the cloud?
Python
JavaScript
What does IDe stand for?
Integrated Development
What is IDe?
Web-based programming environment that is built on top of open source software called Cloud9
What is the CS50 cloud based environment known as?
CS50 IDE
located at cs50.io
What does pedagogical mean?
related to teaching
Any program I write that’s written in the C language
should be named something _____ _____, by convention.
dot c or .c
example:
hello.c
In the environment of CS50 IDE, one is using
an operating system called _____.
Linux
Linux is reminiscent of another operating system, generally known as _____.
Unix
Linux is particularly known for having what type of environment?
Command Line Environment, CLI.
What does CLI stand for?
Command Line Environment
What “flavor” of Linux is CS50 IDE using?
Ubuntu which is just a version of Linux
What is “clang” in the C Language?
a COMPILER which is pre-installed in CS50 IDE
What is the $ mean in the command line?
A convention or PROMPT that means type your commands here.
The default name for programs when you don’t specify a name for your program is just _____.
a.out
Dot slash of ./a.out just means what?
Hey, CS50 IDE, run a program called a.out
that’s inside my current directory.
What does the dot of ./a.out mean?
Current directory
The less that happens on your computer screen, the more likely your code is _____, at least syntactically.
correct
What is “clang” short for?
C Language
A computer is literally going to do what?
Only what I tell it to do
Whenever I change my source code I have to do what in order to allow my computer to read the change?
Run my change through the compiler again.
What does a.out stand for?
Assembly Output
What are other terms for command line arguments?
Flags
Switches
What do command line arguments (flags or switches) influence?
The behavior of a program
What does -o represent?
Output
It is an output command line argument or flag that creates a new folder other than a.out (default)
Example of creating a new folder in command line?
clang -o name hello.c
What does “ls” command do?
Lists the files in the current working directory
What does rm stand for?
remove command
The rm (i.e., remove) command is used to _____ files and directories
delete
What does the asterisk * mean in the command line?
That’s an executable, or runnable program, that one can run by doing dot slash, and then it’s name.
How do I create a new source file in the current working directory with the MAKE program?
simply type in the command line: make filename
Do I need to include the -o or .c to create a new source folder in the command line with the MAKE program?
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
Is MAKE a compiler program?
No
MAKE is a a convenience program that knows how to trigger a _____ to run so that one can use it.
compiler
What does “cd” command stand for?
change directory
What allows one to move forward, backwards, and open up different folders within the command line interface
without using a mouse?
cd (change directory) command
What does “mkdir” mean?
make directory
What does “mkdir” command do?
Makes a new directory (folder)
What does “rm” stand for?
remove
What does “rmdir” stand for?
remove directory
In stdio.h what does the io mean?
i = Input o = output
include command enables us to use what?
printf
printf produces what?
output
In order to use printf what line MUST I have at the top of my code?
include because it enables output
In any C program I write I have to start the code with what?
int main (void) {
}
Strings are like _____.
sentences or sequence of characters
What is the C command to get a string from the user?
get_string()
When I do not want to provide specific input into a puzzle piece or a function how would I write its string?
With empty open and closed parenthesis.
When I call get_string (), where would I place the return value results?
In C I would use a VARIABLE to store the get_string() return value results.
What does the equal sign = mean in C?
It is the “assignment operator” which tells the computer to move a value from the right side to the left side.
What does this mean to the computer:
{
string name = get_string();
}
Hey, computer, give me a string (a sequence of characters) with no inputs and call that string “Name.”
What special syntax would I use to have a “placeholder?”
%s