Quiz 3 Solutions

# Quiz 3 Solutions - 1 int result = 5 8 9 A 4 B 5 C 36 2 int...

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

Computer Science 302 Section 3 Week 4 Quiz Solutions 2006-09-29 Name: For each question, circle the answer that has the correct value of the variable result after the statement(s) has executed. Each question is worth 1 point. Assume that double variables do not suﬀer from rounding or other imprecision errors.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 int result = 5 * 8 % 9; A 4 B 5 C 36 2 int result = 2 + 5 * 4; A 10 B 22 C 28 3 double result = 3 + (double)(5 / 2); A 4.0 B 5.0 C 5.5 4 String temp = "42"; String result = temp + 7; A "42+7" B "427" C "49" 5 double result = (5 * (7 % 2)) + 9) / 0.5; A 14.0 B 28.0 C 32.5 1...
View Full Document

## This note was uploaded on 03/30/2008 for the course CS 302 taught by Professor Willbenton during the Fall '07 term at University of Wisconsin.

Ask a homework question - tutors are online