quiz1 (1)

quiz1 (1) - 1.00/1.001 Introduction to Computers and...

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

View Full Document Right Arrow Icon
1.00/1.001 Introduction to Computers and Engineering Problem Solving Quiz 1 / October 7, 2005 Name: Email Address: TA: Section: You have 90 minutes to complete this exam. For coding questions, you do not need to include comments, and you should assume that all necessary files have already been imported. Good luck. / / / / / / Question Points Question 1 15 Question 2 25 Question 3 10 Question 4 40 Question 5 10 Total 100 HW1 HW2 HW3 1.00/1.001 Quiz 1 1/10 10/07/2004
Background image of page 1

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

View Full DocumentRight Arrow Icon
= Question 1. Data variables / operators (15 points) What is the value of ‘ i ’ when the following statements are executed: 1. int i = -4 + 8/3 + 1%2; i = 2. double i = -4 + 8/3 + 1%2; i = 3. int i = -4 + 8.0/3 +1%2; i = 4. float i = -4 + 8.0F/3 + 1%2; i = 5. int i = -4 + 8/(3 - 1)%2; i 1.00/1.001 Quiz 1 2/10 10/07/2004
Background image of page 2
Answer the following questions about Java by circling TRUE or FALSE, or by circling the correct answer(s) from the multiple choices as appropriate. 1. A static data member is shared by all instances of that class. TRUE FALSE 2. A static data member’s value can never change. TRUE FALSE 3. A static data member can be declared as public or private . TRUE FALSE 4. A private non-static data member of a class may be accessed from any non-static method of that class. TRUE FALSE 5. A local variable declared in one method may be accessed by all the methods beneath it in the same class. TRUE FALSE 6. Which of the following statements is true for the local variable temp as shown in the code fragment below? int i = 100; while(i > 0){ int temp = 0; i--; //rest of implementation hidden } [Note: zero or more options may be correct] a. temp may be accessed anywhere in that method. b.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

quiz1 (1) - 1.00/1.001 Introduction to Computers and...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online