Study sets matching "java chapter 5"

Study sets
Classes
Users

Study sets matching "java chapter 5"

Java Chapter 5
method
void method
value-returning method
method header
collection of statements that perform a specific task... -helps…
performs task, then is finished... ex: System.out.println
-performs a task... -sends a value back to the caller code (spec…
-Never use ;
method
collection of statements that perform a specific task... -helps…
void method
performs task, then is finished... ex: System.out.println
57 terms
JAVA chapter 5
Pseudocode
Flowchart
Flowchart
Sequence structure
Use paper and a pencil... Plan a program's logic by writing plai…
Steps in diagram form... A series of shapes connected by arrows
Programmers use a variety of shapes for different tasks... Recta…
One step follows another unconditionally... Cannot branch away o…
Pseudocode
Use paper and a pencil... Plan a program's logic by writing plai…
Flowchart
Steps in diagram form... A series of shapes connected by arrows
Java Chapter 5
bubble sort
irregular array
multidimensional array
initialize multidimensional arrays
sets up a for loop nested in a for loop, each going in opposi…
int arr[ ][ ] ... = new int[x][ ];... each dim-1 can have a differ…
an array of arrays
= {... {a, b, c},... {d, e, f} ... };
bubble sort
sets up a for loop nested in a for loop, each going in opposi…
irregular array
int arr[ ][ ] ... = new int[x][ ];... each dim-1 can have a differ…
55 terms
Java Chapter 5
Reference Data Types
New Instance of Reference Data Type Sy…
String
String Initialization Syntax
declaring them as variables does not create space for the dat…
Contact myContact = new Contact( );
series of characters that form a line of text, reference data…
String myString = "Greetings";
Reference Data Types
declaring them as variables does not create space for the dat…
New Instance of Reference Data Type Sy…
Contact myContact = new Contact( );
Chapter 5 JAVA
1. What does program flow follow?
2. In what computer language do progra…
3. What are the 3 general types of con…
4. How does Simple Sequence work?
Program Flow follows the exact sequence of listed program sta…
Programs in any computer language require control structures.
They are simple sequence, selection, and repetition.
As mentioned earlier, control was provided by a sequence of p…
1. What does program flow follow?
Program Flow follows the exact sequence of listed program sta…
2. In what computer language do progra…
Programs in any computer language require control structures.
16 terms
Java Chapter 5
pseudocode
flowchart
sequence structure
decision structure
tool that helps programmers plan a program's logic by writing…
tool that helps programmers plan a program's logic by writing…
logical structure in which one step follows another unconditi…
logical structure that involves choosing between alternative…
pseudocode
tool that helps programmers plan a program's logic by writing…
flowchart
tool that helps programmers plan a program's logic by writing…
11 terms
Java Chapter 5
printTodaysDate is a method that accep…
Write the code for invoking a method n…
Write the definition of a method print…
Write the definition of a method twice…
printTodaysDate();
sendObject(John_Doe);
void printAttitude (int pint){... if (pint == 1){... System.out.p…
public static int twice(int a) {... int b = 2 * a;... return b;... }
printTodaysDate is a method that accep…
printTodaysDate();
Write the code for invoking a method n…
sendObject(John_Doe);
Java Chapter 5
Elements required to perform counter-c…
for ( initialization; loopContinuation…
While statement
Scope
loop countercontrol variable (or loop counter);... the Initial V…
for (int COUNTER = 1; COUNTER <= 10; COUNTER++ )... INITIALIZATI…
initialization;... while ( loopContinuationCondition )... {... statem…
of a variable defines where it can be used in a program
Elements required to perform counter-c…
loop countercontrol variable (or loop counter);... the Initial V…
for ( initialization; loopContinuation…
for (int COUNTER = 1; COUNTER <= 10; COUNTER++ )... INITIALIZATI…
10 terms
Java Chapter 5
pixel = getPixel(x,y)
color = pixel.getColor();
color = color.brighter();
pixel.setColor(color)
sets the variable pixel to refer to the Pixel object at the g…
sets the variable color to refer to the Color object at the c…
this creates a new lighter (brighter) Color object based on t…
sets the current pixel's color to be the lighter color.
pixel = getPixel(x,y)
sets the variable pixel to refer to the Pixel object at the g…
color = pixel.getColor();
sets the variable color to refer to the Color object at the c…
Java chapter 5-6
void
header
curly braces
method modifiers, method return type,…
This type of method does not return a value
This appears at the beginning of a method definition
The body of a method is enclosed in
A method header can contain
void
This type of method does not return a value
header
This appears at the beginning of a method definition
15 terms
Java chapter 5
Accessor/Getter
Arguments/actual parameters
Class
Constructor
Method that returns the current value of a specified data fie…
Values that are passed into a method or constructor via the h…
The code that describes the attributes and behavior of an obj…
Subroutine that initializes an object's data fields when the…
Accessor/Getter
Method that returns the current value of a specified data fie…
Arguments/actual parameters
Values that are passed into a method or constructor via the h…
22 terms
#JAVA - Chapter 5 (pre)
Counter-controlled repetition requires:
A common logic error with counter-cont…
Scope (of a variable)
%20s
- a control variable... - initial value... - increment... - loop-conti…
off-by-one error
defines where it can be used in a program
output should be displayed with a field width of 20 -- displa…
Counter-controlled repetition requires:
- a control variable... - initial value... - increment... - loop-conti…
A common logic error with counter-cont…
off-by-one error
30 terms
Java Chapter 5 - Decisions
What is the correct syntax for an if s…
The following code snippet contains an…
What can be done to improve the follow…
What is the problem with the following…
if (condition) { statements; }... else { statements; }
Logical error: if statement has do-nothing statement after if…
Move the duplicated code outside of the if statement
The condition does not evaluate to a Boolean value
What is the correct syntax for an if s…
if (condition) { statements; }... else { statements; }
The following code snippet contains an…
Logical error: if statement has do-nothing statement after if…
13 terms
Think Java Vocabulary Chapter 5
boolean
relational operator
logical operator
short circuit
A data type with only two values, true and false.
An operator that compares two values and produces a boolean i…
An operator that combines boolean values and produces a boole…
A way of evaluating logical operators that only evaluates the…
boolean
A data type with only two values, true and false.
relational operator
An operator that compares two values and produces a boolean i…
14 terms
Big Java Chapter 5
if
relational
==
equals
statement that allows a program to carry out different action…
operators that compare values
tests to see if the objects are identical
used to compare strings
if
statement that allows a program to carry out different action…
relational
operators that compare values
28 terms
chapter 5 java vocab
loop statements
while loop
scope for variable inside of a loop
scope for variable outside a loop
repeatedly execute instructions until a goal has been reached
A loop executes instructions repeatedly while a condition is…
When you declare a variable inside the loop body, the variabl…
the same variable is used for all iterations of the loop
loop statements
repeatedly execute instructions until a goal has been reached
while loop
A loop executes instructions repeatedly while a condition is…
26 terms
Java Chapter 5
pseudocode
flowchart
sequence structure
decision structure
tool that helps programmers plan a program's logic by writing…
tool that helps programmers plan a program's logic by writing…
logical structure in which one step follows another unconditi…
logical structure that involves choosing between alternative…
pseudocode
tool that helps programmers plan a program's logic by writing…
flowchart
tool that helps programmers plan a program's logic by writing…
Java Chapter 5
pseudocode
flowchart
sequence structure
Boolean values
a tool that helps programmers plan a program's logic by writi…
a tool that helps programmers plan a program's logic by writi…
a logical structure in which one step follows another uncondi…
values that are true or false; every computer decision result…
pseudocode
a tool that helps programmers plan a program's logic by writi…
flowchart
a tool that helps programmers plan a program's logic by writi…
11 terms
Java Vocabulary - Chapter 5
void method
value-returning method
method definition
method modifiers
Simply executes a statement then terminates. Examples include…
Returns a value to the statement that called it.... -5.1
A part of creating a method - it consists of a header and a b…
Seen at the beginning of a method header, they define some ru…
void method
Simply executes a statement then terminates. Examples include…
value-returning method
Returns a value to the statement that called it.... -5.1
11 terms
Java Vocabulary - Chapter 5
void method
value-returning method
method definition
method modifiers
Simply executes a statement then terminates. Examples include…
Returns a value to the statement that called it.... -5.1
A part of creating a method - it consists of a header and a b…
Seen at the beginning of a method header, they define some ru…
void method
Simply executes a statement then terminates. Examples include…
value-returning method
Returns a value to the statement that called it.... -5.1
Java Chapter 5
logical operators
examples
only set the image when it needs to ch…
code in English
can be used to combine multiple boolean expressions into one…
! (Not)... && (And)
{... if (!isDown && Greenfoot.isKeyDown("g")) {... setImage ("whi…
if (the-piano-key-is-not-currently-down and the-keyboard-key-…
logical operators
can be used to combine multiple boolean expressions into one…
examples
! (Not)... && (And)
Java Concepts Chapter 5
Condition
Syntax of if statement
Relational operator
not equal
The statement that outputs true or false
if (condition)... {... statement... }... else... {... statement... }
compares values
!=
Condition
The statement that outputs true or false
Syntax of if statement
if (condition)... {... statement... }... else... {... statement... }
Java Chapter 5
Conditional Statement (selection state…
Loop (Repetition Statement)
Not Equal Operator
Block Statement
if, if-else, switch
while, do, for
!=
collection of statements enclosed in braces
Conditional Statement (selection state…
if, if-else, switch
Loop (Repetition Statement)
while, do, for
Java Chapter 5
object
class
encapsulation
instantiation
a runtime entity that contains data and responds to messages.
software package or template that describes the characteristi…
the combining of data and behavior into a single software pac…
the proccess of creating a new object for instance a class; a…
object
a runtime entity that contains data and responds to messages.
class
software package or template that describes the characteristi…
21 terms
Java chapter 5
Integer.parseInt(str)
Parameter variable's scope
Lifetime of a methods local variable
Argument value is passed to a method,…
Example of value returning method
The method in which the parameter is declared
Only while the method is executing
Declared in method heather inside brackets
Integer.parseInt(str)
Example of value returning method
Parameter variable's scope
The method in which the parameter is declared
13 terms
Chapter 5 Java
constants
static
dynamic
class
PI and E
not changing
changing
a ____ is static and never changing
constants
PI and E
static
not changing
Java Chapter 5 Vocab
action
binary operator
binary digit (bit)
boundary value
taking well-defined steps to solve a problem
an operator that requires two operands
a character in binary which is either a 0 or a 1
a value at the beginning or end of the range of values that a…
action
taking well-defined steps to solve a problem
binary operator
an operator that requires two operands
26 terms
Java Chapter 5 Vocab
pseudocode
flowchart
sequence structure
decision structure
tool that helps programmers plan a program's logic by writing…
tool that helps programmers plan a program's logic by writing…
logical structure in which one step follows another unconditi…
a logical structure that involves choosing between alternativ…
pseudocode
tool that helps programmers plan a program's logic by writing…
flowchart
tool that helps programmers plan a program's logic by writing…
Java Chapter 5
pseudocode
flowchart
sequence structure
decision structure
tool that helps programmers plan a program's logic by writing…
tool that helps programmers plan a program's logic by writing…
logical structure in which one step follows another unconditi…
logical structure that involves choosing between alternative…
pseudocode
tool that helps programmers plan a program's logic by writing…
flowchart
tool that helps programmers plan a program's logic by writing…
36 terms
Java Chapter 5
Increment
Decrement
*Take Note
Postfix mode
To____a value means to increase it by one. (page 279)
To____a value means to decrease it by one. (page 279)
++ and -- are unary operators. (page 279)
____means the operator is placed after the variable. (page 279)
Increment
To____a value means to increase it by one. (page 279)
Decrement
To____a value means to decrease it by one. (page 279)
JAVA CHAPTER 5
pseudorandom numbers
priming a loop
Sentinel
Short circuited evaluation
numbers that although derived from predictable and well-defin…
initializing values before a loop to "prime the pump" and gua…
a special value that signals the end of input
the property of the logical operators && and || that prevents…
pseudorandom numbers
numbers that although derived from predictable and well-defin…
priming a loop
initializing values before a loop to "prime the pump" and gua…
Java Chapter 5
++number or -- number
number++ or number--
loop
while loop
prefix mode
postfix mode
a control structures that cause a statement or group of state…
Boolean expression that is tested. A statement or block of st…
++number or -- number
prefix mode
number++ or number--
postfix mode
21 terms
Java Test Chapter 5
Rational Operator
Conditional Expression
Sequential Program
Selection Program
a programming language operator that defines some kind of rel…
features of a programming language, which perform different a…
1 step after another in order
make a choice and you continue based on the decision
Rational Operator
a programming language operator that defines some kind of rel…
Conditional Expression
features of a programming language, which perform different a…
Java Chapter 5
pseudocode
flowchart
sequence structure
decision structure
tool that helps programmers plan a program's logic by writing…
tool that helps programmers plan a program's logic by writing…
logical structure in which one step follows another unconditi…
logical structure that involves choosing between alternative…
pseudocode
tool that helps programmers plan a program's logic by writing…
flowchart
tool that helps programmers plan a program's logic by writing…
15 terms
Chapter 5 Java
Boolean expression
Compound Boolean expression
Conditional control structure
Decision structure
an expression that evaluates to true or false
an expression that includes more than one Boolean expression
a statement that branches program flow depending on a condition
Conditional control structure
Boolean expression
an expression that evaluates to true or false
Compound Boolean expression
an expression that includes more than one Boolean expression
64 terms
Chapter 5 Java
1. What does program flow follow?
2. In what computer language do progra…
3. What are the 3 general types of con…
4. How does Simple Sequence work?
Program Flow follows the exact sequence of listed program sta…
Any
They are simple sequence, selection, and repetition.
A series of program statements are executed in the exact sequ…
1. What does program flow follow?
Program Flow follows the exact sequence of listed program sta…
2. In what computer language do progra…
Any
64 terms
Chapter 5 Java
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
Program flows follows the exact sequence of listed program st…
In any computer language.
They are simple sequence, selection, and repetition.
It alternates the program and executes the logic that it requ…
What does program flow follow?
Program flows follows the exact sequence of listed program st…
In what computer language do programs…
In any computer language.
64 terms
Chapter 5 JAVA
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
Follows the exact sequence of listed program statements, unle…
In any computer language
Simple sequence, selection, and repetition
A series of program statements are executed in the exact sequ…
What does program flow follow?
Follows the exact sequence of listed program statements, unle…
In what computer language do programs…
In any computer language
63 terms
Chapter 5 java
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
The exact sequence of listed program statements, unless direc…
Programs require control structures in any computer language
Simple, selection, repetition
Simple sequence holds no surprise, it is executed in exact se…
What does program flow follow?
The exact sequence of listed program statements, unless direc…
In what computer language do programs…
Programs require control structures in any computer language
Java Chapter 5
Typically, __________ statements are u…
The do...while statement tests the loo…
The __________ statement selects among…
The __________ statement, when execute…
For, while
After
Switch
Continue
Typically, __________ statements are u…
For, while
The do...while statement tests the loo…
After
64 terms
Chapter 5 Java
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
Program Flow follows the exact sequence of listed program sta…
Java computer language is requires for control structure.
The three types of control structures are simple, sequence, a…
Simple Sequence is a series of program statements that are ex…
What does program flow follow?
Program Flow follows the exact sequence of listed program sta…
In what computer language do programs…
Java computer language is requires for control structure.
34 terms
Chapter 5 Java
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
Program Flow follows the exact sequence of listed program sta…
Programs in any computer language require control structures.
Simple sequence, Selection, and repetition.
A series of program statements are executed in the exact sequ…
What does program flow follow?
Program Flow follows the exact sequence of listed program sta…
In what computer language do programs…
Programs in any computer language require control structures.
Chapter 5 Java
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
It follows the exact sequence of listed program statements, u…
Programs in any computer language require control structures.
The 3 general types are simple sequence, selection, and repet…
A series of program statements are executed in the exact sequ…
What does program flow follow?
It follows the exact sequence of listed program statements, u…
In what computer language do programs…
Programs in any computer language require control structures.
64 terms
Chapter 5 Java
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
Program Flow follows the exact sequence of listed program sta…
Programs in any computer language require control structures.
Simple sequence, selection, and repetition are the 3 general…
A series of program statements are executed in the exact sequ…
What does program flow follow?
Program Flow follows the exact sequence of listed program sta…
In what computer language do programs…
Programs in any computer language require control structures.
64 terms
Chapter 5 JAVA
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
Sequence statements unless directed otherwise.
In any language.
Simple sequence, repetition, and selection.
Goes from one statement to the next one.
What does program flow follow?
Sequence statements unless directed otherwise.
In what computer language do programs…
In any language.
Chapter 5 JAVA
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
It follows the exact sequence of listed program statements, u…
Programs in any computer language require control structures.
Simple sequence, Selection, and Repetition are 3 general type…
A series of program statements are executed in the exact sequ…
What does program flow follow?
It follows the exact sequence of listed program statements, u…
In what computer language do programs…
Programs in any computer language require control structures.
Chapter 5 Java
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
The exact sequence of listed program statements, unless direc…
All computer languages.
Simple sequence, selection, and repetition.
A series of program statements are executed in the exact sequ…
What does program flow follow?
The exact sequence of listed program statements, unless direc…
In what computer language do programs…
All computer languages.
52 terms
Chapter 5 Java
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
What are 2 synonyms for Selection?
Programs in any computer language require control structures.
Simple sequence, selection, and repitition
It's a series of program statements that are executed in the…
Conditional branching or decision making
In what computer language do programs…
Programs in any computer language require control structures.
What are the 3 general types of contro…
Simple sequence, selection, and repitition
38 terms
CHAPTER 5 JAVA
What does program flow follow?
In what computer language do programs…
What are the 3 general types of contro…
How does Simple Sequence work?
Follows the exact sequence of listed program statements, unle…
Java
Simple sequence, selection, and repetition.
Provides control by the order in which program statements are…
What does program flow follow?
Follows the exact sequence of listed program statements, unle…
In what computer language do programs…
Java
30 terms
Java Chapter 5
A loop that repeats a specific number…
What will be the value of x after the…
This is a value that signals when the…
This type of loop will always be execu…
Count-controlled loop
15
Sentinel
Post-test loop
A loop that repeats a specific number…
Count-controlled loop
What will be the value of x after the…
15
1 of 10