{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cs31f08midsol

# cs31f08midsol - CS31 Introduction to Computer Science I...

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

Midterm Practice Problems TA: Brian Choi ([email protected]) Section Webpage: http://www.cs.ucla.edu/~schoi/cs31 Problem 1 True False Variable names can begin with an alphabet or a digit. True False A string cannot be empty. True False A character cannot be empty. True False An array can have a size of 0. True False int m = 5.6; won’t compile because types do not match. True False int n = 11 / 5; will create n and initialize it with the value of 2. True False An array index begins with 0. True False for (int i = 0; i <= 49; i++) will run the loop 50 times (assuming i is not modified within the loop). True False If there is a function that does not require any parameters, you can omit parentheses when calling it. True False Constant variables can be modified only in the main() function. True False int x = ‘0’; sets x to an integer 0. True False int x = 0; sets x to an integer 0. True False int x = 0.0; sets x to an integer 0. True

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

cs31f08midsol - CS31 Introduction to Computer Science I...

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

View Full Document
Ask a homework question - tutors are online