Java Sample - nt i=0; i<5 ; i+)cfw_ int j=5; j>0;...

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

View Full Document Right Arrow Icon
Buttons Text Field Cancel Calculate Amount After 10 years Interest Rate % Amount int i=0; i<5 ; i++){ ( int j=5; j>0; j--){ int k=0; k<2; k++) System. out .print((i+j)*k); System. out .print("\t"); em. out .println("\n"); Section A 1. What is a data type ? a. The part of the CPU that does arithmetic. b. A part of main memory used to store data. c. A particular scheme for representing values with bit patterns. d. The collection of variables that a program uses. 2. What is the result of evaluating the following expression? (1/2 + 3.5) * 2.0 a. 8.0 b. 8 c. 7.0 d. 0 3. Assume the following declarations: short a=12 ; int b=33 ; float x = 2.3f; double y = 3.14; Which one of the following expressions will NOT be evaluated using double precision floating point? a. a + x b. 1.5 + 8.6 c. a + b d. x/y 4. What will happen if you try to compile and run the following code ? public class Q { public static void main(String args[] { int anar[] = new int[] {1,2,3}; System.out.println(anar[1]); } } a. 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
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/09/2011 for the course COMPUTING Applying C taught by Professor Jonathen during the Spring '10 term at Staffordshire.

Page1 / 4

Java Sample - nt i=0; i&lt;5 ; i+)cfw_ int j=5; j&gt;0;...

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

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