Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1 - The operation ++ in Java means: Select one: a. That the value of 1 is added

ID: 3850144 • Letter: 1

Question

1 - The operation ++ in Java means:

Select one:

a. That the value of 1 is added to the variable

b. That the program should start executing from the beginning

c. That this line is a comment

d. That the value should be raised to the power of 2

2 - The rules that determine what is allowed in a program are known as the ____ of the language.

Select one:

a. syntax

b. grammar

c. semantics

d. pragmatics

3 - Variables of the type short can have values in the range of:

Select one:

a. integers between -128 and 127 inclusive

b. integers in the range -32768 and 32767

c. integers in the range -2147483648 and 2147483647

d. integers in the range -1024 and 1024

4 - The size of a variable of type double is:

Select one:

a. 8 bytes

b. 4 bytes

c. 2 bytes

d. 16 bytes

5 - A language that generates a syntax error when you try to put a different data type into a variable that it has not be declared for is called a ________ language.

Select one:

a. strongly typed

b. weak typed

c. static typed

d. dynamic typed

6 - Which of the following is an object type?

Select one:

a. byte

b. boolean

c. char

d. String

7 - What output will the following code produce:

int x, y;

boolean sameSign;

x=1;

y=1;

sameSign = ((x>0)==(y>0));

System.out.println(sameSign);

Select one:

a. true

b. 1

c. 0

d. false

8 - A memory location that has been given a name is called a:

Select one:

a. variable

b. type

c. object

d. class

9 - Which of the following is NOT a primitive data type.

Select one:

a. short

b. byte

c. double

d. String

10 - In Java, a variable of type long is ___ bytes in size.

Select one:

a. 2 bytes (16 bits)

b. 4 bytes (32 bits)

c. 8 bytes (64 bits)

d. 1 Byte (8 bits)

11 - A variable of type 'float' is represented in ___ bytes:

Select one:

a. 2 bytes (16 bits)

b. 4 bytes (32 bits)

c. 8 bytes (64 bits)

d. 1 Byte (8 bits)

12 - In java, a variable can only be used in a program if it has first been:

Select one:

a. declared

b. initialized

c. strongly typed

d. instantiated

13 - Subroutines in Java are often referred to as:

Select one:

a. subprograms

b. classes

c. objects

d. methods

14 - What output will the following code produce:

int counter;

counter = 5;

counter += 1;

System.out.println(counter);

Select one:

a. 5

b. 6

c. 0

d. None of the above

15 - What output would the following code produce?

enum Season { SPRING, SUMMER, FALL, WINTER } ;

Season vacation;

vacation = Season.SUMMER;

System.out.println(Season.SUMMER);

Select one:

a. SUMMER

b. Season.SUMMER

c. SPRING, SUMMER, FALL, WINTER

d. None of the above

16 - A statement with the following format

variable1 = ( x>=2) ? x++ : x--;

is employing a:

Select one:

a. conditional operator

b. boolean logic

c. type cast

d. relational operator

17 - True or False: The fetch and execute cycles always alternate?

Select one:

True

False

18 - True or False: A computer is built to carry out instructions that are written in a simple type of language called binary language.

Select one:

True

False

19 - True or False: A variable has a value that can not be changed by the program.

Select one:

True

False

20 - True or False: The word "public" when placed in front of a method declaration in java means that the routine can only be called from within the local class.

Select one:

True

False

21 - True or False: A variable of type boolean in java can have precisely two literals.

Select one:

True

False

22 - True or False: An asynchronous event is one that occurs at an unpredictable time outside the control of the program that the CPU is running.

Select one:

True

False

23 - True or False: Java programs are NOT compiled.

Select one:

True

False

24 - True or False: One of the components of a computer is its CPU, which converts the Input to the Output

Select one:

True

False

25 - True or False: A name for a constant value in java is called a literal.

Select one:

True

False

26 - True or False: An enum (enumerated type) is a example of an object type instead of a primitive type?

Select one:

True

False

Explanation / Answer

The answers are given below

1 - The operation ++ in Java means:
Select one:
a. That the value of 1 is added to the variable
b. That the program should start executing from the beginning
c. That this line is a comment
d. That the value should be raised to the power of 2

Answer: option a)That the value of 1 is added to the variable


2 - The rules that determine what is allowed in a program are known as the ____ of the language.
Select one:
a. syntax
b. grammar
c. semantics
d. pragmatics

Answer: option b) grammar.

3 - Variables of the type short can have values in the range of:
Select one:
a. integers between -128 and 127 inclusive
b. integers in the range -32768 and 32767
c. integers in the range -2147483648 and 2147483647
d. integers in the range -1024 and 1024

Answer: option b. integers in the range -32768 and 32767

4 - The size of a variable of type double is:
Select one:
a. 8 bytes
b. 4 bytes
c. 2 bytes
d. 16 bytes

Answer option a. 8 bytes


5 - A language that generates a syntax error when you try to put a different data type into a variable that it has not be declared for is called a ________ language.
Select one:
a. strongly typed
b. weak typed
c. static typed
d. dynamic typed

Answer option b. weak typed


6 - Which of the following is an object type?
Select one:
a. byte
b. boolean
c. char
d. String

Answer option d. String


7 - What output will the following code produce:
int x, y;
boolean sameSign;
x=1;
y=1;
sameSign = ((x>0)==(y>0));
System.out.println(sameSign);
Select one:
a. true
b. 1
c. 0
d. false

Answer option a. true

8 - A memory location that has been given a name is called a:
Select one:
a. variable
b. type
c. object
d. class

Answer option a. variable


9 - Which of the following is NOT a primitive data type.
Select one:
a. short
b. byte
c. double
d. String

Answer option d. String


10 - In Java, a variable of type long is ___ bytes in size.
Select one:
a. 2 bytes (16 bits)
b. 4 bytes (32 bits)
c. 8 bytes (64 bits)
d. 1 Byte (8 bits)

Answer option c. 8 bytes (64 bits)


11 - A variable of type 'float' is represented in ___ bytes:
Select one:
a. 2 bytes (16 bits)
b. 4 bytes (32 bits)
c. 8 bytes (64 bits)
d. 1 Byte (8 bits)
Answer option b. 4 bytes (32 bits)

12 - In java, a variable can only be used in a program if it has first been:
Select one:
a. declared
b. initialized
c. strongly typed
d. instantiated

Answer option b. initialized


13 - Subroutines in Java are often referred to as:
Select one:
a. subprograms
b. classes
c. objects
d. methods

Answer option d. methods


14 - What output will the following code produce:
int counter;
counter = 5;
counter += 1;
System.out.println(counter);
Select one:
a. 5
b. 6
c. 0
d. None of the above

Answer option b. 6

15 - What output would the following code produce?
enum Season { SPRING, SUMMER, FALL, WINTER } ;
Season vacation;
vacation = Season.SUMMER;
System.out.println(Season.SUMMER);
Select one:
a. SUMMER
b. Season.SUMMER
c. SPRING, SUMMER, FALL, WINTER
d. None of the above

Answer option a. SUMMER

16 - A statement with the following format
variable1 = ( x>=2) ? x++ : x--;
is employing a:
Select one:
a. conditional operator
b. boolean logic
c. type cast
d. relational operator

Answer option a. conditional operator

17 - True or False: The fetch and execute cycles always alternate?
Select one:
True
False
Answer: true

18 - True or False: A computer is built to carry out instructions that are written in a simple type of language called binary language.
Select one:
True
False
Answer: true

19 - True or False: A variable has a value that can not be changed by the program.
Select one:
True
False
Answer: false


20 - True or False: The word "public" when placed in front of a method declaration in java means that the routine can only be called from within the local class.
Select one:
True
False
Answer: false

21 - True or False: A variable of type boolean in java can have precisely two literals.
Select one:
True
False
Answer: true


22 - True or False: An asynchronous event is one that occurs at an unpredictable time outside the control of the program that the CPU is running.
Select one:
True
False
Answer: true

23 - True or False: Java programs are NOT compiled.
Select one:
True
False
Answer: false

24 - True or False: One of the components of a computer is its CPU, which converts the Input to the Output
Select one:
True
False
Answer: true

25 - True or False: A name for a constant value in java is called a literal.
Select one:
True
False
Answer: true

26 - True or False: An enum (enumerated type) is a example of an object type instead of a primitive type?
Select one:
True
False
Answer: true