Shared Flashcard Set

Details

C++ Ch1-2
Programming
68
Computer Science
Undergraduate 1
12/28/2010

Additional Computer Science Flashcards

 


 

Cards

Term
what are the two components of the cpu?
Definition
the control unit and the arithmatic logic unit
Term
What is the purpose of the control unit?
Definition
to use computer operations
Term
What is teh fetch/decode/execute cycle?
Definition
cpu process
Term
Define fetch in the process?
Definition
CPU fetches from main memory, the next instruction in the the sequence of program instructions
Term
Define decode in the process of fetch, decode, execute?
Definition
instruction is encoded into a number, control unit decodes it and generates an electronic signal
Term
Define execute in the process of fetch, decode, execute?
Definition
signal is routed to appropriate component of the computer (any device) causes component to perform operation
Term
What is the main memory?
Definition
RAM
Term
What is secondary memory?
Definition
any long term storage device
Term
What are the five components of any computer system?
Definition
1)CPU 2)Input 3)output 4)Main memory 5)Secondary storage
Term
Define algorithm?
Definition
set of well defined steps for performing a task or solving a problem
Term
Define portability?
Definition
C++ program can be written on one type and run on another with litle modification
Term
Define source code?
Definition
statments written by programmer
Term
Define run time library?
Definition
set of code in C++ used for mathematic functions
Term
What is the purpose of the preprocessor?
Definition
It finds lines with #, allows it to modify the source code
Term
What is the purpose of the compiler?
Definition
translates source code to machine language and looks for syntax errors
Term
What is the purpose of the linker?
Definition
links the program to the run time library and makes the code executable
Term
Define integrated development environment?
Definition
includes text editor, compiler, debugger, and other utilities
Term
define keywords?
Definition
specific meaning, can only be used for that purpose, always written in lower case
Term
define operators?
Definition
perofrm operations on one or more operands, i.e. a piece of data
Term
define syntax?
Definition
the rules of a computer system
Term
the use of the = sign can be called what?
Definition
an assignment operator
Term
define variable?
Definition
named storage location in computer's memory for holding a piece of information
Term
Where are variables stored?
Definition
In RAM
Term
what is the difference between variable definition and variable declaration?
Definition
defintion always cause a variable to be placed in memory, declartions do not always have to
Term
What are the 3 primary activities of a program?
Definition
Input, process, output
Term
what is a logical error?
Definition
mistakes that cuase a program to produce erroneous results
Term
define desk checking?
Definition
programmer reads part of the program and steps through each statment
Term
what is the purpose of procedural programming?
Definition
make a program that prodcues a specific task
Term
what is the function of // ?
Definition
beginning of a comment, ignored by computer, runs to end of line
Term
define a preprocessor directive?
Definition
i.e. #, preprocessor reads program, looks for #, and only executes those lines, 'set up' to compiler
Term
what is the purpose of the iostream?
Definition
a files that allows C++ to display out on screen and read from keyboard
Term
what is the purpose of the namespace std?
Definition
declares that program will be accessing entries whose names are part of the namespace called std, must be set with entities in the iostream
Term
what is the purpose of int main ()?
Definition
this is the beginnig of a function, starting point of the program
Term
what is a string literal or string constant?
Definition
the characters inside quotation marks
Term
what is the purpose of return 0; ?
Definition
sends the interger value 0 back to OS upon completion, 0 usually indicates success
Term
purpose of the #?
Definition
marks beginning of preprocessor directive
Term
purpose of <,>?
Definition
encloses a filename, used with # include directive
Term
purpose of (,)?
Definition
used in naming function, i.e. int main ()
Term
purpose of {,}?
Definition
enclsoes a group of statments
Term
what is a variable definition and give an example?
Definition
int number, assigning a definition to a variable
Term
what is the difference between a string literal and an integer literal?
Definition
quotes vs. =
Term
what are the 2 rules for legal identifiers (1 of 2)?
Definition
1) first character underscore or a-z or A-Z,
Term
what are the 2 rules for legal identifiers (2 of 2)?
Definition
2) after first character, a-z, A-Z, underscore 0-9
Term
what is the purpose of an unsigned data type?
Definition
only to store non-negative numbers
Term
how can you define two variables (i.e. x and y) in one line?
Definition
int x, y;
Term
how do you force an integer literal to be stored as a long integer, i.e 32?
Definition
32L
Term
what does ASCII stand for?
Definition
american standard code for information
Term
what data type is char?
Definition
essentially its an integer data type
Term
how do you define a char literal, i.e. x?
Definition
char letter; letter= 'x';
Term
How is a string (i.e. ghost) stored?
Definition
it is stored consecutively in memory, ghost\0 = 6 bytes
Term
what is a c-string?
Definition
a string of characters stored in memory with null terminator of the number 0
Term
what is a floating point number?
Definition
any real number i.e. fractional
Term
define the mantissa?
Definition
the actual number in scientific notation, 4.6e10-> the mantissa is 4.6
Term
define float (single precision)?
Definition
+/- 3.4E-38 to 3.4E+38
Term
define double (double precision)?
Definition
+/- 1.7E-308 to positive E-308
Term
Define long double precision (long double)?
Definition
1.7E-308 to positive but in some computers +/-3.4E-4932 to +/-1.1E4832
Term
is there such thing as an unsigned floating point data type?
Definition
No, because float, double and long double store negative numbers also
Term
how are floating point literals stored in memory?
Definition
stored as doubles
Term
How do you force a literal to be stored as float?
Definition
Add F or f to the end
Term
How do you force a literal to be stored as a long double?
Definition
Add L, l
Term
What happens when you assign a floating point to an integer variable such as int i; float f; f=7.5; i=f?
Definition
i=7, it is truncated and not rounded
Term
What happens if a floating point is stored as an integer and the floating point is too large?
Definition
an invalid value will be stored
Term
What is a boolean variable?
Definition
set to either true or false
Term
define initialization, give an example?
Definition
declaring a variable and assigning it at the same time; i.e. int month; int days; month=2, days=30 OR int month=2, days=30
Term
define scope?
Definition
part of the program where the variable may be used, you can't expect to use the variable before you define it
Term
what happens when you divide 2 integers, i.e. 17/3?
Definition
the remainder is discarded
Term
how would you divide 2 integers (17/3) and show remainder?
Definition
make 17 floating point 17.0
Term
how do you open and close multi line comments?
Definition
/*,*/
Supporting users have an ad free experience!