Deck 2: Using Data

ملء الشاشة (f)
exit full mode
سؤال
The term ____ refers to the mathematical accuracy of a value.

A) float data
B) real integers
C) significant digits
D) single-precision floating-point number
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Constants hold a single value for the duration of the program execution.
سؤال
A ____ data type can hold 14 or 15 significant digits of accuracy.

A) double
B) float
C) char
D) boolean
سؤال
____ refers to the order in which values are used with operators.

A) Associativity
B) Initialization
C) Declaration
D) Floating
سؤال
Multiplication, division, and remainder always take place after addition or subtraction in an expression.
سؤال
A variable can hold more than one value at a time.
سؤال
A ____ is a named memory location that you can use to store a value.

A) cast
B) variable
C) reference
D) primitive
سؤال
The term parse means to break into component parts.
سؤال
A data item is ____ when it cannot be changed while a program is running.

A) variable
B) constant
C) primitive
D) literal
سؤال
Once a variable has been declared and initialized, new values may not be assigned to the variable.
سؤال
You can create a confirm dialog box with five arguments.
سؤال
The expression boolean isTenLarger = (10 < 5) will produce a value of true.
سؤال
You are limited to declaring a maximum of three variables in a single statement.
سؤال
In Java, ____ is a built-in class that provides you with the means for storing and manipulating character strings.

A) Escape
B) Type
C) String
D) Character
سؤال
Primitive types serve as the building blocks for more complex data types, called ____ types.

A) integer
B) literal
C) reference
D) data
سؤال
In Java, you use variables of type ____ to store integers, or whole numbers.

A) num
B) double
C) var
D) int
سؤال
A(n) ____ variable can hold only one of two values: true or false.

A) integer
B) boolean
C) true
D) comparison
سؤال
You use the ____ data type to hold any single character.

A) single
B) char
C) byte
D) float
سؤال
The legal integer values are -2³¹ through 2³¹-1. These are the highest and lowest values that you can store in four bytes of memory, which is the size of an int variable.
سؤال
Even if a statement occupies multiple lines, the statement is not complete until the semicolon is reached.
سؤال
____________________ forces a value of one data type to be used as a value of another type.
سؤال
When a numeric variable is concatenated to a String, the entire expression becomes a(n) ____.

A) int
B) constant
C) method
D) String
سؤال
A(n) ____________________ is a simple data type.
سؤال
When you write programs that accept ____________________, there is a risk that the user will enter the wrong type of data.
سؤال
You use ____ operators to perform calculations with values in your programs.

A) calculation
B) arithmetic
C) integer
D) precedence
سؤال
What is the value of result after the following statement is executed? int result = 2 + 3 * 4;

A) 9
B) 10
C) 14
D) 20
سؤال
A(n) ____ dialog box asks a question and provides a text field in which the user can enter a response.

A) question
B) JOptPane
C) confirm
D) input
سؤال
The percent sign is the ____ operator.

A) remainder
B) remaining
C) percentage
D) integer division
سؤال
A(n) ____________________ operator compares two items and the result has a Boolean value.
سؤال
The characters ____ move the cursor to the next line when used within a println() statement.

A) /n
C).+
B) \n
D) $
سؤال
The ____ is the type to which all operands in an expression are converted so that they are compatible with each other.

A) unifying type
B) data type
C) numbered
D) primitive
سؤال
Which escape sequence will move the cursor to the beginning of the current line?

A) \b
B) \r
C) \\
D) \n
سؤال
In Java, when a numeric variable is concatenated to a String using the ____, the entire expression becomes a String.

A) plus sign
B) equal sign
C) concatenate statement
D) string statement
سؤال
____ occurs when both of the operands are integers.

A) Data modeling
B) Type cast
C) Integer division
D) Unlike assignment
سؤال
You can store any character, including nonprinting characters such as a backspace or a tab, in a(n) ____ variable.

A) int
B) char
C) boolean
D) set
سؤال
A(n) ____________________ number contains decimal positions.
سؤال
You may declare an unlimited number of variables in a statement as long as the variables are ____.

A) the same data type
B) initialized to the same value
C) properly commented
D) floating point numbers
سؤال
Each primitive type in Java has a corresponding class contained in the java.lang package. These classes are called ____ classes.

A) case
B) primitive
C) type-wrapper
D) show
سؤال
A(n) ____ dialog box displays the options Yes, No, and Cancel.

A) confirm
B) input
C) message
D) answer
سؤال
Which of the following is NOT a component of a variable declaration statement?

A) data type identifier
B) symbolic constant
C) variable name
D) ending semicolon
سؤال
How would you ask the user to confirm an action using a dialog box?
سؤال
In Java, how is it possible to perform mathematical operations on operands with unlike types?
سؤال
Explain how you can override a unifying type imposed by Java.
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
The operator that is represented by an equal sign (=)
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
A programming term for an unknown value
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
A floating-point data type
سؤال
Describe how the use of named constants can provide advantages over the use of literal values.
سؤال
What is an escape sequence and why would a Java programmer use it to store a character?
سؤال
Describe how to assign values based on the result of comparisons to Boolean variables.
سؤال
A variable declaration is a statement that reserves a named memory location. It includes what four elements?
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Java consistently specifies their size and format
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Begins with a backslash followed by a character
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
A value that can be used on either side of an operator
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Created by placing the desired result type in parentheses
سؤال
What is the difference between the float data type and the double data type?
سؤال
Describe and give an example of operator precedence.
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Rules for the order in which parts of a mathematical expression are evaluated
سؤال
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
true or false
سؤال
How can you create and use an input dialog box in Java?
سؤال
Describe the variation types byte, short, and long of the integer type.
سؤال
Write the statement that will declare and assign two integer variables, salesAmt and costAmt, in a single statement. Assign values of your choice to the variables.
سؤال
Describe why it is important to assign an appropriate data type to variables in an application.
سؤال
Write the statement to declare an uninitialized integer value for salesAmt.
سؤال
Why is the following relational operator expression invalid? How could you rewrite the statement so that it is valid?
boolean isGradePassing = (grade => 70);
سؤال
How could you alter the following statement to display "Welcome" on one line and "back" on another line?
System.out.println("Welcome back");
سؤال
char aCharacter = 2;
int aNumber = '2';
In the above statements, what values will be output after a println() statement is executed? Why are the output results different for the two statements?
سؤال
import javax.swing.JOptionPane;
public class salesJune
{
public static void main(String[] args)
{
int storeSales = 250;
______________________________
}
}
In the above code, complete the statement that will display a message dialog box that will appear centered on the screen and will display the following text:
Congratulations! June sales were $250!
سؤال
Describe three ways in which a constant differs from a variable.
سؤال
Describe how the Scanner class works with the System.in object in order to provide flexibility.
سؤال
Write the statement that will declare a char data type named testScore that will hold a letter grade of your choice.
سؤال
public class YourGrade
{
public static void main(String[] args)
{
int projectPoints = 89;
System.out.print("Your grade for this class is ");
System.out.print(projectPoints);
System.out.println("%");
}
}
Given the above code, what will be the output at the command prompt?
سؤال
final int COSTPERITEM = 10;
double sales2012 = amtSold * COSTPERITEM;
In the above statements, identify the named constant and describe how a programmer can recognize named constants.
سؤال
public class EndValue
{
public static void main(String[] args)
{
int aByte = 940;
System.out.print("The ending value is "+ aByte);
}
}
When the above code is compiled, what error message will be generated and why?
سؤال
Describe the error message that will be produced when the following code is compiled.
public class SalesOct
{
public static void main(String[] args)
{
int salesAmt;
System.out.print("October sales are $");
System.out.println(salesAmt);
}
}
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/74
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 2: Using Data
1
The term ____ refers to the mathematical accuracy of a value.

A) float data
B) real integers
C) significant digits
D) single-precision floating-point number
C
2
Constants hold a single value for the duration of the program execution.
True
3
A ____ data type can hold 14 or 15 significant digits of accuracy.

A) double
B) float
C) char
D) boolean
A
4
____ refers to the order in which values are used with operators.

A) Associativity
B) Initialization
C) Declaration
D) Floating
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
5
Multiplication, division, and remainder always take place after addition or subtraction in an expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
6
A variable can hold more than one value at a time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
7
A ____ is a named memory location that you can use to store a value.

A) cast
B) variable
C) reference
D) primitive
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
8
The term parse means to break into component parts.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
9
A data item is ____ when it cannot be changed while a program is running.

A) variable
B) constant
C) primitive
D) literal
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
10
Once a variable has been declared and initialized, new values may not be assigned to the variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
11
You can create a confirm dialog box with five arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
12
The expression boolean isTenLarger = (10 < 5) will produce a value of true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
13
You are limited to declaring a maximum of three variables in a single statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
14
In Java, ____ is a built-in class that provides you with the means for storing and manipulating character strings.

A) Escape
B) Type
C) String
D) Character
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
15
Primitive types serve as the building blocks for more complex data types, called ____ types.

A) integer
B) literal
C) reference
D) data
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
16
In Java, you use variables of type ____ to store integers, or whole numbers.

A) num
B) double
C) var
D) int
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
17
A(n) ____ variable can hold only one of two values: true or false.

A) integer
B) boolean
C) true
D) comparison
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
18
You use the ____ data type to hold any single character.

A) single
B) char
C) byte
D) float
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
19
The legal integer values are -2³¹ through 2³¹-1. These are the highest and lowest values that you can store in four bytes of memory, which is the size of an int variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
20
Even if a statement occupies multiple lines, the statement is not complete until the semicolon is reached.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
21
____________________ forces a value of one data type to be used as a value of another type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
22
When a numeric variable is concatenated to a String, the entire expression becomes a(n) ____.

A) int
B) constant
C) method
D) String
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
23
A(n) ____________________ is a simple data type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
24
When you write programs that accept ____________________, there is a risk that the user will enter the wrong type of data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
25
You use ____ operators to perform calculations with values in your programs.

A) calculation
B) arithmetic
C) integer
D) precedence
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
26
What is the value of result after the following statement is executed? int result = 2 + 3 * 4;

A) 9
B) 10
C) 14
D) 20
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
27
A(n) ____ dialog box asks a question and provides a text field in which the user can enter a response.

A) question
B) JOptPane
C) confirm
D) input
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
28
The percent sign is the ____ operator.

A) remainder
B) remaining
C) percentage
D) integer division
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
29
A(n) ____________________ operator compares two items and the result has a Boolean value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
30
The characters ____ move the cursor to the next line when used within a println() statement.

A) /n
C).+
B) \n
D) $
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
31
The ____ is the type to which all operands in an expression are converted so that they are compatible with each other.

A) unifying type
B) data type
C) numbered
D) primitive
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which escape sequence will move the cursor to the beginning of the current line?

A) \b
B) \r
C) \\
D) \n
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
33
In Java, when a numeric variable is concatenated to a String using the ____, the entire expression becomes a String.

A) plus sign
B) equal sign
C) concatenate statement
D) string statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
34
____ occurs when both of the operands are integers.

A) Data modeling
B) Type cast
C) Integer division
D) Unlike assignment
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
35
You can store any character, including nonprinting characters such as a backspace or a tab, in a(n) ____ variable.

A) int
B) char
C) boolean
D) set
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
36
A(n) ____________________ number contains decimal positions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
37
You may declare an unlimited number of variables in a statement as long as the variables are ____.

A) the same data type
B) initialized to the same value
C) properly commented
D) floating point numbers
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
38
Each primitive type in Java has a corresponding class contained in the java.lang package. These classes are called ____ classes.

A) case
B) primitive
C) type-wrapper
D) show
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
39
A(n) ____ dialog box displays the options Yes, No, and Cancel.

A) confirm
B) input
C) message
D) answer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
40
Which of the following is NOT a component of a variable declaration statement?

A) data type identifier
B) symbolic constant
C) variable name
D) ending semicolon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
41
How would you ask the user to confirm an action using a dialog box?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
42
In Java, how is it possible to perform mathematical operations on operands with unlike types?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
43
Explain how you can override a unifying type imposed by Java.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
44
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
The operator that is represented by an equal sign (=)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
45
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
A programming term for an unknown value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
46
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
A floating-point data type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
47
Describe how the use of named constants can provide advantages over the use of literal values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
48
What is an escape sequence and why would a Java programmer use it to store a character?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
49
Describe how to assign values based on the result of comparisons to Boolean variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
50
A variable declaration is a statement that reserves a named memory location. It includes what four elements?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
51
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Java consistently specifies their size and format
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
52
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Begins with a backslash followed by a character
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
53
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
A value that can be used on either side of an operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
54
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Created by placing the desired result type in parentheses
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
55
What is the difference between the float data type and the double data type?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
56
Describe and give an example of operator precedence.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
57
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
Rules for the order in which parts of a mathematical expression are evaluated
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
58
MATCHING
Match each term with the correct statement below.
a.operand
f.primitive
b.cast operator
g.float
c.assignment
h.boolean
d.operator precedence
i.escape sequence
e.garbage
true or false
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
59
How can you create and use an input dialog box in Java?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
60
Describe the variation types byte, short, and long of the integer type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
61
Write the statement that will declare and assign two integer variables, salesAmt and costAmt, in a single statement. Assign values of your choice to the variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
62
Describe why it is important to assign an appropriate data type to variables in an application.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
63
Write the statement to declare an uninitialized integer value for salesAmt.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
64
Why is the following relational operator expression invalid? How could you rewrite the statement so that it is valid?
boolean isGradePassing = (grade => 70);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
65
How could you alter the following statement to display "Welcome" on one line and "back" on another line?
System.out.println("Welcome back");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
66
char aCharacter = 2;
int aNumber = '2';
In the above statements, what values will be output after a println() statement is executed? Why are the output results different for the two statements?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
67
import javax.swing.JOptionPane;
public class salesJune
{
public static void main(String[] args)
{
int storeSales = 250;
______________________________
}
}
In the above code, complete the statement that will display a message dialog box that will appear centered on the screen and will display the following text:
Congratulations! June sales were $250!
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
68
Describe three ways in which a constant differs from a variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
69
Describe how the Scanner class works with the System.in object in order to provide flexibility.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
70
Write the statement that will declare a char data type named testScore that will hold a letter grade of your choice.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
71
public class YourGrade
{
public static void main(String[] args)
{
int projectPoints = 89;
System.out.print("Your grade for this class is ");
System.out.print(projectPoints);
System.out.println("%");
}
}
Given the above code, what will be the output at the command prompt?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
72
final int COSTPERITEM = 10;
double sales2012 = amtSold * COSTPERITEM;
In the above statements, identify the named constant and describe how a programmer can recognize named constants.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
73
public class EndValue
{
public static void main(String[] args)
{
int aByte = 940;
System.out.print("The ending value is "+ aByte);
}
}
When the above code is compiled, what error message will be generated and why?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
74
Describe the error message that will be produced when the following code is compiled.
public class SalesOct
{
public static void main(String[] args)
{
int salesAmt;
System.out.print("October sales are $");
System.out.println(salesAmt);
}
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 74 في هذه المجموعة.