IU Bloomington Evaluation Services and Testing

Indiana University
Bloomington Evaluation Services and Testing

QuizSite  Students
Quizzes · Tests · Evaluations · Surveys
Activity: Practice_Five
Student: dgerman (Adrian German)
Instructor: dgerman
Course: J201 Section: 4285
Question 1.
What is the output produced by the following code when embedded in a complete program?
int x = 14;
while (x < 15)
  x = x + 1;
  System.out.print(x); 
Please type your answer in the following box:

Note that the program may or may not be indented correctly so think about it carefully.


Question 2.
What is the output produced by the following code when embedded in a complete program?
int x = 14;
while (x < 15)
  x = x + 1;
System.out.print(x); 
Please type your answer in the following box:

Note that the program may or may not be indented correctly so think about it carefully.


Question 3.
What is the output produced by the following code when embedded in a complete program?
int x = 14;
while (x <= 15) {
  x = x + 1;
System.out.print(x); } 
Please type your answer in the following box:

Note that the program may or may not be indented correctly so think about it carefully.


Question 4.
What is the output produced by the following code when embedded in a complete program?
int i;
for (i = 0; i < 3; i = i + 1)
  System.out.print(1);
System.out.print(0); 
Please type your answer in the following box:

Note that the program may or may not be indented correctly so think about it carefully.


Question 5.
What is the output produced by the following code when embedded in a complete program?
int i;
for (i = 0; i < 3; i = i + 1) {
  System.out.print(1);
System.out.print(0); } 
Please type your answer in the following box:

Note that curly braces have been added and that the program may or may not be indented correctly so think about it carefully.


Question 6.
What is the output produced by the following code when embedded in a complete program?
int x = 10, y = 3;
while (x > 0 && y > 0)
  x = x - y;
  System.out.print(x);
Please type your answer in the following box:

Note that the program may or may not be indented correctly so think about it carefully.


Question 7.
What is the output produced by the following code when embedded in a complete program?
int x = 10, y = 3;
while (x > 0 && y > 0) {
  x = x - y;
} System.out.print(x);
Please type your answer in the following box:

Note that the program is the one from question 1 with an extra pair of curly brackets added. It may or may not be indented correctly so think about it carefully.


Question 8.
What is the output produced by the following code when embedded in a complete program?
int x = 10, y = 3;
while (x >= 0 && y > 0) {
  x = x - y;
  System.out.print(x);
}  
Please type your answer in the following box:

Note that the program is the one from question 1 with an extra pair of curly brackets added. It may or may not be indented correctly so think about it carefully.


Question 9.
What is the output produced by the following code when embedded in a complete program?
int x = 10;
while (x > 0)
  x = x - 3;
  System.out.print(x);
Please type your answer in the following box:


Question 10.
What is the output produced by the following code when embedded in a complete program?
int x = 10;
while (x > 0)
  x = x - 3;
System.out.print(x);
Please type your answer in the following box:


Question 11.
What is the output produced by the following code when embedded in a complete program?
int x = 10;
while (x > 0) {
  x = x - 3;
}
System.out.print(x);
Please type your answer in the following box:


Question 12.
What is the output produced by the following code when embedded in a complete program?
int x = 10;
while (x > 0) {
  x = x - 3;
System.out.print(x);
}
Please type your answer in the following box:


Question 13.
What is the output produced by the following code when embedded in a complete program?
int x = 10;
while (x < 0) {
  x = x - 3;
}
System.out.print(x);
Please type your answer in the following box:


Click to submit your answers.   Help


This activity is available between these dates and times: 07.08.10:00-08.11.19:59
It can be submitted a total of 30 times.
If it is a scored activity, the highest non-zero score will be counted.


Screen: TAKE_QUIZ
Last updated: Thu Mar 8 13:40:07 2001
URL: https://www.indiana.edu/~best/cgi-bin/quizsite/students.pl
Comments: best@indiana.edu
Copyright 2000, BEST & The Trustees of Indiana University