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

Q25. StringTokenizer tokenizer = new StringTokenizer(keyboard.readLine()); int l

ID: 3887869 • Letter: Q

Question

Q25.

StringTokenizer tokenizer = new StringTokenizer(keyboard.readLine());
int limit = Integer.parseInt(tokenizer.nextToken());
int counter = 0;
while(counter < limit){
      entry = Integer.parseInt(tokenizer.nextToken());
      triple = entry *3;
      System.out.println(triple);
      counter++;
}

The above code is an example of a(n) ____ while loop.

   a. flag-controlled
   b. counter-controlled
   c. EOF-controlled
   d. sentinel-controlled

Q28. The value returned by a value-returning method can be saved for further calculation in the program.
   a. true
   b. false

Q33. How many constructors can a class have?
   a. 0
   b. 1
   c. 2
   d. Any number

Explanation / Answer

Ques25:

b) counter-controlled - Counter controlled needs a variable, its increment, initial value and which makes it counter control.

Counter is incrementing by 1 in this example.

Ques 28:

true.

Value can be stored in any variable and can be used further in the program.

Q33.

d. Any number.

There can be multiple constructor of a class with zero or more arguements to the constructor.