Exam1 - Name: _ Midterm 1 CS 5JA Winter 2008 Short Answer:...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Name: ________________________ Midterm 1 CS 5JA Winter 2008 Short Answer: _____/27 Output: _____/20 Programming: _____/25 Total: _____/72
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
(18)Given the following declarations, for each of the following Java assignment statements, write what value is of the assigned variable. This is not considered a block of code – all expressions assume the initial values of the variables. int x = 2; int y = 35; char c = ‘d’; boolean b = true; boolean b2 = false; char c2 = 'a'; Assignment statement Value or Explanation x = x / 9; x = x = y % 6; x = b = (x < 20); b = c = ‘d’ + 5; c = x++; x = b = (10 < x ) & (y > 15); b = (4) I would like to declare a variable that is of type WhizBangClass. I also need to allocate an object of that type of class in order to use it. Write one or two lines of code that will declare the variable and allocate the object . (5) What control construct does the following control flow diagram correspond to?
Background image of page 2
(20) Tracing code– Make sure you look very, very carefully! What will this code print out?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Exam1 - Name: _ Midterm 1 CS 5JA Winter 2008 Short Answer:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online