221HW14 - 1 0b1 iii 2 0b10 iv 3 0b11 v 4 0b100 vi 10 0b1010 vii 15 0b1111 viii 16 0b10000 ix 100 0b1100100 C For each of the following tracing

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 221 Homework 14 1. In the appendix of the text for CSE 222 (appendices also used in CSE 221 and CSE 321) read the Natural Number section. Make sure you understand the idea of radix notation. Then answer the following questions. A. Describe a situation, other than the one in the appendix, where using Integer objects wouldn't let you compute with values large enough to do some computation you might want to perform. A situation where the answer is greater than 2^31. B. Write the following numbers, shown here in decimal (radix-10) notation, in binary (radix- 2) notation: i. 0 0b0 ii.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 0b1 iii. 2 0b10 iv. 3 0b11 v. 4 0b100 vi. 10 0b1010 vii. 15 0b1111 viii. 16 0b10000 ix. 100 0b1100100 C. For each of the following tracing tables, write a single statement that would take you from the initial state to the corresponding final state. Assume the following declarations: object Natural_Number_1_C n1, n2; object Integer k; i. n1 = 123456 k = -42 what statement? n1 = 12345 k = 6 ii. n1 = 78 k = 9 what statement? n1.Clear(); n1 = 789 k = 9 iii. n1 = 865365765768 n2 = 9732457521 k = 62 what statement? n1 = 9732457521 n2 = 865365765768 k = 62...
View Full Document

This note was uploaded on 09/19/2008 for the course CSE 221 taught by Professor Mathias during the Spring '08 term at Ohio State.

Ask a homework question - tutors are online