Quiz 2 cs 161

Quiz 2 cs 161 - INTRO TO COMPUTER SCIENCE...

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

View Full Document Right Arrow Icon
INTRO TO COMPUTER SCIENCE I (CS_161_001_W2010) (CS_161_001_W2010) > ASSIGNMENTS > REVIEW ASSESSMENT: BLACKBOARD QUIZ/WORKSHEET 2
Background image of page 1

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

View Full DocumentRight Arrow Icon
Review Assessment: Blackboard Quiz/Worksheet 2 Matthew T Cook 1/19/10 11:45 PM Blackboard Quiz/Worksheet 2 Completed 105 out of 105 points After you take this quiz, check your grades on Blackboard to m Question 1 5 out of 5 points What is the largest (positive) value you can store in a variable of type byte? Selected Answer: Question 2 5 out of 5 points Decide which compiler you are going to use. There are directions on our web site for using Eclipse. Create a new project (a Java Application). Put these statements in the main method and run the program: byte b1 = 128; System.out.println(b1); Does it compile? (Yes / No) Selected Answer:
Background image of page 2
Question 3 5 out of 5 points Change the main method to contain these statements: byte b1 = 127; System.out.println(b1); Does it compile? (Yes / No) Selected Answer: Question 4 5 out of 5 points A byte can hold integers from -128 to 127 inclusive. You can force a number > 127 to be a byte, but you might not like the result. It's called casting. Change main to have these two statements. byte b1 = (byte)150; //casting 150 to be a byte System.out.println(b1); What is printed out? Selected Answer:
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.

This note was uploaded on 10/19/2010 for the course CS 161 taught by Professor Wallace during the Fall '08 term at Oregon State.

Page1 / 9

Quiz 2 cs 161 - INTRO TO COMPUTER SCIENCE...

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