Comp113-2010_Midterm_1of2_VerA_wAns

Comp113-2010_Midterm_1of2_VerA_wAns - COMP113Midterm...

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

View Full Document Right Arrow Icon
COMP113—Midterm #1—Winter 2010 Ver. A ANSWER KEY Page 1 of 10 COMP 113 – Computer Programming I Computing Science Department School of Advanced Technologies and Mathematics Version A ANSWER KEY COURSE: COMP 113 INSTRUCTOR: R.J. Lippelt SEMESTER: Winter 2010 DATE: 10 Feb 2010 Student Name: _______________________________ Student Number: _______________________________ Part 1 Multiple Choice: ___________ / 5 Fill-in-the-Blank: ___________ / 9 Evaluate Java Expressions: ___________ / 12 Part 2 Short Answer Question: ___________ / 6 Java Code Output: ___________ / 14 Fix Java Syntax Errors: ___________ / 7 Part 3 Convert Multi-Branch Statements: ___________ / 21 Programming Question: ___________ / 11 Total : ___________ / 85 Please place all solutions in the space provided MIDTERM EXAMINATION I
Background image of page 1

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

View Full DocumentRight Arrow Icon
COMP113—Midterm #1—Winter 2010 Ver. A ANSWER KEY Page 2 of 10 Multiple Choice Questions: 1. Which of the following is NOT a Java data type? Circle all that apply _____ / 5 (i) Int (ii) byte (iii) float (iv) Double (v) boolean (vi) char (vii) Long (viii) short (ix) String (x) dollar Answer : Int, Double, Long, String, dollar Fill-in-the-Blanks 1. Convert the decimal number: 113 to binary (Show your work below) Answer: 1110001 Answer: _____________________________________________ _____ / 3 2. Convert the binary number: 111000111 to hexadecimal (Show your work below) Answer: 1C7 Answer: _____________________________________________ _____ / 3 3. Convert the octal number: 762 to binary (Show your work below) Answer: 111110010 Answer: _____________________________________________ _____ / 3
Background image of page 2
COMP113—Midterm #1—Winter 2010 Ver. A ANSWER KEY Page 3 of 10 Evaluate the Following Java Expressions: 1. int result = 2 * 7 - 3 + 6 / 4; Answer : 12 Answer: _____________________________________________ _____ / 3 2. (int) (5 * 4.25); Answer : 21 Answer: _____________________________________________ _____ / 3 3. boolean loopAgain = ((18.0/6.0) == (2.0*3.0)); Answer : false Answer: _____________________________________________ _____ / 3 4. System.out.println((char)((int)’q’ + 3)); Answer : t Answer: _____________________________________________ _____ / 3
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 04/17/2011 for the course COMP 1130 taught by Professor Na during the Fall '11 term at Thompson Rivers.

Page1 / 10

Comp113-2010_Midterm_1of2_VerA_wAns - COMP113Midterm...

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