Programming in The Large (SE101) Mid-Term Exam

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Programming In The Large (SE101) Mid-Term Exam https://docs.google.com/forms/d/e/1FAIpQLSdc7J6UNFzK2tbW3qJMA...

Programming In The Large (SE101) Mid-


Term Exam
Choose the correct answer for each of the following questions

elzoghby2021@gmail.com Switch account

* Required

Email *

Your email

The trailing (last) else in multi-way if statement has a similar purpose as the
keyword default in switch statement *

TRUE

FALSE

‫* ﺍﻻﺳﻡ ﺍ ﻟﺭﺑﺎﻋﻲ ﺑﺎﻟﻛﺎﻣﻝ )ﻣﻛﺗﻭﺏ ﺑﺎﻟ ﻠﻐﺔ ﺍ ﻟﻌﺭﺑﻳﺔ(؟‬

Your answer

‫ﺍﻟﻛﻭﺩ ﺍﻟﺩﺭﺍﺳﻲ )ﺇﻥ ﻭﺟﺩ(؟‬

Your answer

1 of 7 12/17/2021, 10:00 AM
Programming In The Large (SE101) Mid-Term Exam https://docs.google.com/forms/d/e/1FAIpQLSdc7J6UNFzK2tbW3qJMA...

The following code segment: double average = w + v + x + y + z / 5.0; calculates


the average of five predefined integer variables w, v, x, y and z, whose values are
entered by user, has …. error *

SYNTAX

RUNTIME

LOGIC

NO

The following code segment: if ( x % 2 == 0 ) System.out.println("even");


determines if a predefined integer variable x is even or not, based on its entered
value by user, has …. error *

SYNTAX

RUNTIME

LOGIC

NO

Postfix ++ and -- operators have the lowest precedence among all operators *

TRUE

FALSE

2 of 7 12/17/2021, 10:00 AM
Programming In The Large (SE101) Mid-Term Exam https://docs.google.com/forms/d/e/1FAIpQLSdc7J6UNFzK2tbW3qJMA...

Writing a semicolon directly after the condition of an if statement causes a


syntax error *

TRUE

FALSE

The following code segment: System.out.println(num1 % num2); calculates the


remainder (modulus) of dividing two predefined integer variables num1 and
num2, whose values are entered by user, may have … error *

SYNTAX

RUNTIME

LOGIC

NO

Expression: y = y + 1; is equivalent to expression: x =+ 1; *

TRUE

FALSE

Integer value can be read or stored in floating-point variable *

TRUE

FALSE

3 of 7 12/17/2021, 10:00 AM
Programming In The Large (SE101) Mid-Term Exam https://docs.google.com/forms/d/e/1FAIpQLSdc7J6UNFzK2tbW3qJMA...

The default initial value of boolean variable is the logic value of false *

TRUE

FALSE

The following code segment: if( invalidInput ) System.out.println("\nError: you


entered an invalid input); System.out.println("\nReenter a new valid input: ");
should print an error message due to invalid user input and ask user to reenter a
new valid input, with assumption that invalidInput is a predefined boolean
variable containing a certain logic value of true or false, has … error *

SYNTAX

RUNTIME

LOGIC

NO

Floating-point literal (value) is assumed by default to be of type double *

TRUE

FALSE

Class Scanner is imported from package java.lang for reading input. *

TRUE

FALSE

4 of 7 12/17/2021, 10:00 AM
Programming In The Large (SE101) Mid-Term Exam https://docs.google.com/forms/d/e/1FAIpQLSdc7J6UNFzK2tbW3qJMA...

Java programming language is not case sensitive *

TRUE

FALSE

Relational operators == and != have lower level of precedence than all other
relational operators *

TRUE

FALSE

The .class file has the interpreted binary machine code for the .java file with the
same name *

TRUE

FALSE

The following statement: if ( ! ( x != 1 ^ x != 2 ) ) can be rewritten as … : *

if ( x != 1 && x != 2)

if ( x == 1 || x == 2)

if ( x == 1 ^ x == 2 )

if ( x == 1 && x == 2 )

5 of 7 12/17/2021, 10:00 AM
Programming In The Large (SE101) Mid-Term Exam https://docs.google.com/forms/d/e/1FAIpQLSdc7J6UNFzK2tbW3qJMA...

All logical operators have the same precedence level *

TRUE

FALSE

Keyword default is not optional in switch statement structure *

TRUE

FALSE

The associatively of operator %= is from right to left *

TRUE

FALSE

The following if condition: if ( count < 0 && count > 100 ) determines if variable
count is outside the range of 0 through 100 *

TRUE

FALSE

switch statement selects a decision based on an expression of type char, byte,


short, int or String. *

TRUE

FALSE

6 of 7 12/17/2021, 10:00 AM
Programming In The Large (SE101) Mid-Term Exam https://docs.google.com/forms/d/e/1FAIpQLSdc7J6UNFzK2tbW3qJMA...

year-4 is a valid name for a variable *

TRUE

FALSE

Logical operator ^ outputs value true when its both operands are different;
otherwise it outputs value false *

TRUE

FALSE

Class Scanner has the method named short() that is used to read a short integer
value from the keyboard, *

TRUE

FALSE

Keyword break should be written at the end of each case in the switch statement
*

TRUE

FALSE

Submit Page 1 of 1 Clear form

Never submit passwords through Google Forms.

This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy

 Forms

7 of 7 12/17/2021, 10:00 AM

You might also like