Quiz2.fa08

Quiz2.fa08 - Signature cs11f CSE 11 Quiz 2 Fall 2008 Name...

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

View Full Document Right Arrow Icon
Signature _____________________ CSE 11 Name ________________________ Quiz 2 cs11f ____ Fall 2008 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no calculators. (Partial) Operator Precedence Table Operators Associativity * / % left to right + - left to right < <= > >= left to right == != left to right && left to right || left to right = right to left 1) What is the value of amt for each of the expressions below? Note the type declarations for each. To represent an integer value, do not write a decimal point (for example: 99 or 42). To represent a double value, write a decimal point and one digit to the right of the decimal point (for example: 99.0 or 42.5). int amt = 10; amt = amt + amt * (5 / 100); ____________ int amt = 10; amt = (int) (amt + amt * (5 / 100.0)); ____________ double amt = 10; amt = amt + amt * (5 / 100); ____________ double amt = 10; amt = amt + amt * (5 / 100.0); ____________ 2) Assume a program contained the following declarations:
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 01/07/2011 for the course CSE CSE11 taught by Professor Cs during the Spring '10 term at UCSD.

Page1 / 2

Quiz2.fa08 - Signature cs11f CSE 11 Quiz 2 Fall 2008 Name...

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