Search Header Logo

Understanding Selection in Pseudocode

Authored by Suraj Motee

Computers

11th Grade

Understanding Selection in Pseudocode
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

OPEN ENDED QUESTION

3 mins • 1 pt

What will be the output for x = -4 and y = 7? DECLARE x, y: INTEGER INPUT x, y IF x > 0 THEN IF y > 0 THEN OUTPUT "First Quadrant" ELSE OUTPUT "Fourth Quadrant" ENDIF ELSE IF y > 0 THEN OUTPUT "Second Quadrant" ELSE OUTPUT "Third Quadrant" ENDIF ENDIF

Evaluate responses using AI:

OFF

2.

OPEN ENDED QUESTION

3 mins • 1 pt

What will be the output for x = 0 and y = -5? DECLARE x, y : INTEGER INPUT x, y IF x = 0 THEN IF y = 0 THEN OUTPUT "Point is at the origin" ELSE OUTPUT "Point lies on the Y-axis" ENDIF ELSE IF y = 0 THEN OUTPUT "Point lies on the X-axis" ELSE OUTPUT "Point is not on any axis" ENDIF ENDIF

Evaluate responses using AI:

OFF

3.

OPEN ENDED QUESTION

3 mins • 1 pt

What will be the output when x = 15? DECLARE x : INTEGER INPUT x IF x >= 10 AND x <= 20 THEN OUTPUT "x is in the range 10-20" ELSE OUTPUT "x is out of range" ENDIF

Evaluate responses using AI:

OFF

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Complete the pseudocode below to check if a number is positive, negative or zero. DECLARE num : INTEGER INPUT num IF num ___ 0 THEN OUTPUT "The number is positive" ELSE IF num __ 0 THEN OUTPUT "The number is negative" ELSE OUTPUT __________________ ENDIF ENDIF

greater than

less than

equal to

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Complete the pseudocode to check if a number is a multiple of another number. DECLARE num1, num2 : INTEGER INPUT num1, num2 IF num1 MOD num2 __ 0 THEN OUTPUT num1, " is a multiple of " , num2 ELSE OUTPUT num1, " is not a ______________ ", _________ ENDIF

multiple

divisor

6.

OPEN ENDED QUESTION

3 mins • 1 pt

Complete the pseudocode below that reads the lengths of 3 sides of a triangle from the user and display a message indicating the type of the triangle. DECLARE side1, side2, side3 : __ INPUT __, __, __ IF __ = __ AND __ = __ THEN OUTPUT "__" ELSE IF __ = __ OR __ = __ OR __ = __ THEN OUTPUT "__" ELSE OUTPUT "__" ENDIF ENDIF

Evaluate responses using AI:

OFF

7.

OPEN ENDED QUESTION

3 mins • 1 pt

You are writing a program that checks whether the entered character is a number, a lowercase letter, or an uppercase letter. If the user enters a digit (0-9), the program should display a message indicating that the entered character is a digit. If the entered character is a lowercase letter, the program should display a message indicating that it is a lowercase letter. If the entered character is an uppercase letter, the program should display a message indicating that it is an uppercase letter. If the entered character is anything else, the program should indicate that the entered character is not a letter or digit. DECLARE character : __ INPUT __ IF __ >= "0" AND __ <= "9" THEN OUTPUT "__" ELSE IF __ >= "a" AND __ <= "z" THEN OUTPUT "__" ELSE IF __ >= "A" AND __ <= "Z" THEN OUTPUT "__" ELSE OUTPUT "__" ENDIF END IF ENDIF

Evaluate responses using AI:

OFF

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?