1midterm2cmps450fall09 - 2nd Midterm Exam CMPS 450.2 Dr....

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

View Full Document Right Arrow Icon
2nd Midterm Exam — CMPS 450.2 Dr. Anthony Maida November 19, 2009 Instructions: Put your name and student CLID (e.g., axy2991) on each page. Part 1: The following questions are worth 2 points each unless stated otherwise. 1. In Java , what is the range of values that can be stored in the primitive type byte ? a. 0 to 255 b. -128 to 127 c. -127 to 128 d. -256 to 255 e. -255 to 256 2. Why is the array reference array[ix] safe in the code segment below? . . } 3. The char data type in JAVA uses how many bits? a. 4 b. 8 c. 16 d. 32 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
4. Which of the following is not characteristic of Java primitive types? a. unicode characters b. one’s complement integer arithmetic c. IEEE 754 floating point arithmetic d. negative zero for floating point numbers e. wrapper classes for floating point types 5. (3 pts) What is the name of the representation scheme that Java uses to store negative integers? Assume hypothetically that Java has a data type — whose size is three bits — to represent integers. Create a complete, sorted list of all the numbers that can be stored. Give binary representations and their base ten equivalents. Identify the positive numbers, the negative numbers, and zero. 6. Which operator below, in
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

1midterm2cmps450fall09 - 2nd Midterm Exam CMPS 450.2 Dr....

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

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