quiz1b_spring03

quiz1b_spring03 - 1.00 Introduction to Computers and...

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

View Full Document Right Arrow Icon
1.00 Introduction to Computers and Engineering Problem Solving Quiz 1 March 7, 2003 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 / 15 Question 3 / 20 Question 4 / 50 Total / 100 1.00 Spring 2003 Quiz 1 1/7 2/5/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
Problem 1. (15 points) Refer to the following code fragment to answer the TRUE or FALSE statements as appropriate: public class Quiz1 { private double quizAvg; public static void main(String[] args) { int i = 2; double d = Math.pow(36, 1/i); System.out.println(d); float k = i; for (i=0; i<5; i++) { //outer for loop for (int j=0; j<5; j++) { //inner for loop if (j==2) { break; } } } } public Quiz1(double q) {quizAvg= q:} } a. The program above outputs the value 6.0 . TRUE FALSE b. The statement float k = i; is a legal statement. ( I.e. , it will compile and run.) TRUE FALSE c. When j is equal to 2, the break statement forces the main method to quit the outer for loop and to proceed with the statement after the break . TRUE
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 / 7

quiz1b_spring03 - 1.00 Introduction to Computers and...

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