COMP 248 Winter 2016
Getting started in the lab
Get your computer account from ENCS help
Note that computer science students will keep their
account throughout their studies; but non-computer
science students will have their acco
COMP 248 - Winter 2016
Predict the output of the following program. Then run it to make
sure your answers are right.
My university name is Concordia.
The following Java program contains several syntax errors. Identify
COMP 248 -Winter 2016
Suppose the following definitions; What is the output of the
following independent fragments?
Predict the output of the following segment of code:
What is the value of the fo
COMP 248 - Tutorial #5
Switch & While and DoWhile Loops
Question 9: Assume the following fragment of code:
Scanner myKeyboard = new Scanner(System.in);
String msg = myKeyboard.next();
int x = 0;
int y = 10;
int z = 100;
COMP 248 - Tutorial #3
Boolean expressions & selection instructions
Question 1: What output will be produced by the following code?
public class SelectionStatements
public static void main(String args)
int number = 24;
if(number % 2 = 0)
COMP 248 - Tutorial #4 Loops
Question 1: What is the output of the following?
a) int count = 0;
while ( count <= 6 )
System.out.print( count + " " );
count = count + 2;
int count = 7;
while ( count >= 4 )
COMP 248 - Tutorial #2
Question 1: What is the type of the values 0, 0.0, '0' and "0"?
Question 2: Which of the following are legal identifiers?
Question 3: Given the following decl