This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Midterm Practice Problems TA: Brian Choi (email@example.com) Section Webpage: http://www.cs.ucla.edu/~schoi/cs31 ENJOY! 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; wont 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 &lt;= 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 False int x = 0.5; sets x to an integer 0. True False You will ace the exam....
View Full Document
- Spring '09
- Computer Science