1/120
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
program
set of instructions that a computer follows to perform a certain task
CPU
part of the computer that runs the program; fetches instructions and produces some result
parts of the CPU
control unit and ALU
ALU (arithmetic and logic unit)
perform math operations
control unit
retieves and decodes program instructions and coordinates computer operations
three parts of a program
input, processing, output
main memory
holds both instructions and data
secondary storage
type of memory that can hold data for long periods of time
three things that make the program run
preprocessor, compiler, linker
volatile memory
temporary (ex. RAM)
low-level language
resembles numeric language of the computer
high-level language
close to human-readibility
algorithim
a set of well-defined steps for performing a task or solving a problem
operating system software
program that manage the computer software and runs on the compute
computer
programmable machine designed to follow instructions
main components of hardware
CPU, main memory (RAM), secondary storage devices, input devices, output devices
smallest to biggest piece of memory
bit, byte, word
application software
programs that provide services to the user
common elements in programming
key words, programmer-defined identifiers, operators, punctuation, syntax
variable
named location in computer memory
structured programming
-divide problem into smaller subproblems
-implementing a structured design
object-oriented programming
-specify relevat data and possible operations to be performed on that data
-each object consists of data and operations on that data
-combines data and operations into a single unit
namespace
organizes the names of program entities
cout
console output
vaiables provide interface to where?
RAM
literal
piece of data written directly into a program’s code (characters, strings, numbers, anything not a key word)
identifier rules
made up of letters, numbers, and _
must start with alphabet character or _ character
c++ variable types
bool, char, int, float, double
c++ integer data types
short, int, long
c++ floating-point data types
float, double, long double
unsigned
program never needs negative numbers
decimal
base 10
hexadecimal
base 16; place a 0x before it
octal
base 8; place a 0 before it
notation for floating-point values
E notation or fixed point (decimal) notation
data types for floating-point numbers
float, double, long double
true number value
one
false number value
zero
variables’ scope
part of the program that has access to the bariable
three types of operators
unary, binary, ternary
#include
inserts the contents of another file into the program
L
store an integer in a long memory location
\0
null terminator at the end of every string
sizeof()
gives the size of number of bytes
floating-point divided by any number equals
a floating point
file that must be included to use cout
iostream
comments
notes of eplanation that document lines or sections of a program
«
feeds the data into the cout
»
feeds user input to variable
pow(double x,y)
exponent function
type coercian
conversion of the operands of the same type (promoted vs. demoted)
hierchary of data types
long double
double
float
unsigned long
long
unsigned int
int
unsigned short
short
char
static_cast<dataType>
how to change the type
setw()
prints spaces
setprecision()
sets numbe of sig digs you want
cin.ignore()
ignores the newline character (null terminator) after previous entered variable
array
group of memory cells
order of operations
negatives
multiplication, divison, modules
addition, subtraction
char, short, and unsigned short are promoted to
int
the ___ variable gets converted to the one on the _____
right; left
#define
do not occupy memory location; works as a text substitution
iomanip
header file for controlling how output is displayed
c-string
stores characters in an array
strcpy()
how to assign a value to c-string later
srand()
initializes random number generator with unsigned int “seed”
flag
a variable that signals a condition
logical precedence
! && ||
operators precedence
arithmetic relational logical
variables defined inside curly brackets
local or block scope
expr1 ? expr2 : expr3;
2 if 1 is true; 3 if 1 is false
short circuit
when to use prefix mode?
when you want the increment to occur first
do-while loops perform at least ____ iteration before checking the condition
one
toupper()
changes it to uppercase
break
terminates execution of the loop
continue
causes the code to skip this interation and go to the next one
sentinel
indicates end of loop
ifstream infile
input
ofstream outfile
output
size of an array
number of bytes * number of elements
another way to initialize a variable
variableType value(VALUE)
for(dataType name : array){
}
range-based for loop
how to access data from file
parallel arrays
building relationships between data stored in two or more arrays
array vs. vector
-size not needed
-automatcally adjusts itself
-can initialize a vector in another
how to declare a vector
vector<type> name
pop_back()
removes last element from vector
push_back(value)
adding a value to the vector
pop_back()
removes a value from the vector
function that doesn’t return anything
void
compiler needs to know what about the function?
name, return type, number of parameters, data type of parameters
function prototype
notifies the compiler about a function
prototype formation
returnType nameOfFunction(argument)
static
preserves local variables when function terminates
example of secondary storage device
disk drive
machine language
language that computer really processes
portability
program’s ability to run on several toes of systemsq
punctuation
marks the beginning and end of sentences
input
info from the outside world