quiz8 - Name: _ Section: Dave's 15-100 M N O P March 18,...

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

View Full Document Right Arrow Icon
1 Name: ____________________ Section: M N O P Dave's 15-100 March 18, 2009 Quiz 8 1. The variables i and d have been declared and initialized as follows: int i = 3; double d = 2.8; Write the value of each of the following expressions. If the value is an int , write the value with no decimal point (as in 1 or 2 ). If the value is a double , write the value with a decimal point and with at least one digit to the right of the decimal point (as in 1.5 or 2.0 ). Thus, if the correct value is the integer 1 , then a response of 1.0 will be marked as incorrect. Likewise, if the correct value is the double 1.0 , then a response of 1 will be marked as incorrect. i + d __________ i / 2 __________ d / 2 __________ i / 2.0 __________ (double)i __________ (int)d __________ ((int)0.5) * i __________ (int)(0.5 * i) __________ (double)(i / 2) __________ ((double)i) / 2 __________
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Reference Location Class Location (int row, int col) int getRow () int getCol () Color Class Color (int red, int green, int blue)
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 / 3

quiz8 - Name: _ Section: Dave's 15-100 M N O P March 18,...

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