Exam 2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

T/F A Boolean variable can hold only two values

true

In python, what is the value returned by 7 % 2

1

what is the value returned by 5 // 2

2

T/F logical operator determines whether a specific relationship exists between two values

true

T/F string comparisons are done using the ASCII code

true

what is the decimal value of the binary number 0000110

6

In python, between all the logical operators, the Not operator has lower precedence than _____

AND

what is the binary number of the decimal number 10 A. 00001110 B. 00000111 C. 00001011 D. 00001010

D

if the following pseudocode was coded and run, what would display, given that rate = 8? Select rate: Case 10: Display "Ten" Case 9: Case 8: Display "Eight" Case 7: Case 6: Display "Six" Default: Display "Rating not possible." End Select

Eight

T/F The AND operator will evaluate to False only if both subexpressions are also False

False

T/F The short-circuit evaluation is always performed with all expressions that contain any logical operators

False

T/F the OR operator will evaluate to FALSE only if both subexpressions are also True

False

If an expression is False, the ___ operator will return True

NOT

which of the following operators is used in most languages to test if two operands do not have the exact same value

!=

T/F A nested decision structure can achieve the same logic as a case structure

True

T/F A nested decision structure can be used to test more than one condition

True

T/F In many languages the == operator determines whether one variable has the same value as another variable

True

in a flowchart, the ___ symbol indicates that some condition must be tested

diamond

A case structure is a ___ alternative decision structure

multiple


Set pelajaran terkait

Biology Chapter 7 HMK: DNA Structure and Replication

View Set

Coursera week 1 clinical terminology

View Set

Physiological Basis of Strength and Conditioning

View Set

CommuVoc 21-02 Collocations in Use: Everyday verbs 2 - combined exercises

View Set

Bus Law II Chapters 14, 15, & 16

View Set

INCLINED PLANE, WEDGE, AND SCREW

View Set

Chapter 1: Introduction to Earth

View Set

Cardiac Output and Blood Pressure

View Set