2551.quiz3.Summer2007

2551.quiz3.Summer2007 - Upper Case letters start with the...

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

View Full Document Right Arrow Icon
COP 2551 – Quiz #3 Summer 2007 Name: ___________________ Directions : Circle the True or False; Write in the letter for multiple choice on the dotted line. 1. (True, False)………. . The value of a condition in an IF or a While is boolean, which means it evaluates to either true or false. 2……. Which of the following sets of operators has lowest precedence? a. arithmetic operators b. equality operators c. relational operators d. logical operators 3………. Same as question 2. Which has highest precedence? 4 (True, False) ………. Logical NOT, AND, and OR all have the same precedence and it is below arithmetic operators. 5…6. In the following Java statement, clearly indicate the order of all operators: if ( a > b+c || a < r/s 7-8. Write the following condition as a simple ifthenelse statement. larger = ((num1 < num3) ? num1 : num2); 9. (True, False). ......... The switch statement can take a character as the expression to be evaluated. 10………….
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Upper Case letters start with the internal representation of a. 48 b. 64 c. 65 d. 97 e. 122 11-12. Given two strings string1 and string2, write the expression that compares the two of them. Write this in an if statement. I will start it for you if ( ) 13. When the compare takes place, what type is returned from the comparison of the two strings? (write in your answer) one word: 14-16. Write a while loop that sums the first 100 positive integers. Start with 1. 17-19. Same as previous problem. Use a for loop. 20-22. Same; use a dowhile loop 23-25. What output is produced by the following code fragment? int num = 87, max = 25; if (num &gt;= max*2) System.out.println (apple); System.out.println (orange); System.out.println (pear); Output is: 26-28What output is produced by the following code fragment? int num = 0, max = 20 while (num&lt;max) { System.out.println (num); num += 4; } output:...
View Full Document

Page1 / 2

2551.quiz3.Summer2007 - Upper Case letters start with the...

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

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