Shared Flashcard Set

Details

AP Comp sci ch 2,3
AP COMP SCI test chapters 1,2,3 http://www.duke.edu/~trc7/cps/help/glossary.html
21
Computer Science
Not Applicable
10/25/2007

Additional Computer Science Flashcards

 


 

Cards

Term
Assignment
Definition
An assignment statement is used to give a value to a variable. It looks like this:
  • "x = 5;" - MAKE SURE TO USE ONE EQUAL SIGN!
Term
Boolean
Definition
A boolean is a variable type that can only have one of two possible values - TRUE or FALSE. Booleans are commonly used in conditionals and loops.
Term
Char
Definition
A char is a variable type that represents a single character.  Chars can be any single letter, number or any other type of single character.
Term
Comment
Definition

Comments are used to make notes on your program without affecting the code. By simply writing two slashes // before any text that text will not be compiled. This is a good way to take notes, explain complicated code, or to write for each function what each parameter should mean and what is returned to ensure the user knows what is going on.

Term
Comparison
Definition
Comparison statements are used in Conditionals and Loops. They usually look like this:
  • "(x == 5)" - MAKE SURE TO USE TWO EQUAL SIGNS!
  • "(x > 5)"
  • "(x < 5)"
Term
Compile
Definition
A Java program is written in sourcecode and then compiled into bytecode. This bytecode is then interpreted by the Java Virtual Machine.
Term
Conditional
Definition
A conditional statement is a series of code that allows the execution of portions of a program according to the value of some Comparison statement. Conditionals use �if�, �else if�, and �else�s to decide what code to execute based on a test statement of some kind. Conditionals are basically like �if-then� statements in English. They usually look like this:

if (x == 5)
{
    x = x + 19;
}
Term
Double
Definition
A double is a numeric variable type that is similar to a float. Doubles are all real numbers, meaning that they can be used with decimals..
Term
Float
Definition
A float is a numeric variable type that is not only all integers, but includes all decimals as well. Floats are often used when an exact division is necessary rather than division with no remainders.
Term
Function
Definition
A function is a piece of code that is self-contained in a program. Each function should perform a specific task, and can be called from other functions. A function is �called� by using a statement that calls the name of a function followed by whatever necessary parameters in parentheses after the name. Functions are the basic way of organizing a program into smaller steps. Every function is declared by saying whether it is public or private, whether it is void or returns a value, its name, and any parameters.
Term
If Statement
Definition
An if statement is a conditional which states that if some test statement is true, the code in the brackets below the if statement should be executed.
Term
If-Else Statement
Definition
An if-else statement is a conditional that states that if some test statement is true, the code between the brackets below the if statement should be executed. Otherwise, the code between the brackets below the else statement should be executed.
Term
Inheritance
Definition
Inheritance in Java refers to when a class �extends� another class. The class that is defined as extending another class is the subclass. The subclass can use any variables or functions defined in the original class (called the super class) as its own as long as they are not defined as �private�.
Term
int
Definition
An int is a numeric variable type. It is the basic, generic variable for integer values.
Term
Loops
Definition
Loops are segments of code that are repeated either for a designated number of times or until a certain test statement is true.
Term
Private
Definition
Private sections of code (or variables) may only be accessed by other portions of code in the same class.
Term
Public
Definition
When you see the word public, it means that the function or the variable that is being defined can be used by any other function, class or program. This is the opposite of private functions, which may only be accessed by other portions of code in the same class.
Term
String
Definition
A string is a variable type that stores text data. Strings are assigned values by either using an assignment statement to another String type variable or by putting quotation marks around the text that you want them to equal.

EXAMPLE:    String name = �Andrew�;
Term
Variable
Definition
A variable is a piece of data associated with a class or an object. A variable is the interface between the user and the data in the computer, a way for the user to call on that data.
Term
Void
Definition
When you see the word void, it means that the function it is associated with does not return a value. Any void function has no value and can not be used like a variable like functions that return a value can.
Term
While Loop
Definition

While loops are sections of code that are designed to be repeated as long as a certain condition is met. While loops need all four essential parts of a loop: initialization, test statement, update, and the loop body. In a while loop, the initialization happens before the loop. The test statement is the only thing in the parentheses after the word "while." The update portion of a while loop actually occurs within the loop body. While loops usually look like the code below:

int timesRolled = 0;

while(timesRolled < 4)
{
    RollDice();
    timesRolled++;

Supporting users have an ad free experience!