# quiz8 - Name Section Dave's 15-100 M N O P Quiz 8 1 The...

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

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 __________

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

View Full Document
2 Reference Location Class Location (int row, int col) int getRow () int getCol () Color Class Color (int red, int green, int blue)
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/14/2010 for the course CS 15-100 taught by Professor Dave during the Spring '08 term at Carnegie Mellon.

### Page1 / 3

quiz8 - Name Section Dave's 15-100 M N O P Quiz 8 1 The...

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

View Full Document
Ask a homework question - tutors are online