3073 Ch.2

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

This operator performs division, but instead of returning the quotient it returns the remainder. 1. % 2. * 3. ** 4. /

1. %

This operator performs integer division. 1. // 2. % 3. ** 4. /

1. //

A magic number is: 1. a number that is mathematically undefined 2. an unexplained value that appears in a program's code 3. a number that cannot be divided by 1 4. a number that causes computers to crash

1. a number that is mathematically undefined

Short notes placed in different parts of a program explaining how those parts of the program work are called 1. comments 2. reference manuals 3. tutorials 4. external documentation

1. comments

A ___________is a diagram that graphically depicts the steps that take place in a program. 1. flowchart 2. step chart 3. code graph 4. program graph

1. flowchart

Which built-in function can be used to read input that has been typed on the keyboard? 1. input() 2. get_input() 3. read_input() 4. keyboard()

1. input()

In the expression 12 + 7, the values on the right and left of the + symbol are called . 1. operands 2. operators 3. arguments 4. math expressions

1. operands

A______ is a name that references a value in the computer's memory. 1. variable 2. register 3. RAM slot 4. byte

1. variable

Which of the following statements will cause an error? 1. x = 17 2. 17 = x 3. x = 99999 4. x = '17'

1. x = 17

A(n)___ makes a variable reference a value in the computer's memory. 1. variable declaration 2. assignment statement 3. math expression 4. string literal

2. assignment statement

Suppose the following statement is in a program: price = 99.0. After this statement executes, the price variable will reference a value of which data type? 1. int 2. float 3. currency 4. str

2. float

Which built-in function can be used to convert an int value to a float? 1. int_to_float() 2. float() 3. convert() 4. int()

2. float()

A___ is a name that represents a value that does not change during the program's execution. 1. named literal 2. named constant 3. variable signature 4. key term

2. named constant

An informal language that has no syntax rules and is not meant to be compiled or executed is called 1. faux code 2. pseudocode 3. Python 4. a flowchart

2. pseudocode

A___________ is a single function that the program must perform in order to satisfy the customer 1. task 2. software requirement 3. prerequisite 4. predicate

2. software requirement

A______ is any hypothetical person using a program and providing input for it. 1. designer 2. user 3. guinea pig 4. test subject

2. user

This is an operator that raises a number to a power. 1. % 154 2. * 3. ** 4. /

3. **

A ___________error does not prevent the program from running, but causes it to produce incorrect results. 1. syntax 2. hardware 3. logic 4. fatal

3. logic

A___________is a sequence of characters. 1. char sequence 2. character collection 3. string 4. text block

3. string

This symbol marks the beginning of a comment in Python. 1. & 2. * 3. ** 4. #

4. #

A(n)___________ is a set of well-defined logical steps that must be taken to perform a task. 1. logarithm 2. plan of action 3. logic schedule 4. algorithm

4. algorithm

A___string literal in Python must be enclosed in 1. parentheses. 2. single-quotes. 3. double-quotes. 4. either single-quotes or double-quotes.

4. either single-quotes or double-quotes.

According to the behavior of integer division, when an integer is divided by an integer, the result will be a float.

False

In Python, math expressions are always evaluated from left to right, no matter what the operators are.

False

Python formats all floating-point numbers to two decimal places when outputting with the print statement.False

False

Since a named constant is just a variable, it can change any time during a program's execution.

False

A flowchart is a tool used by programmers to design programs.

True

Comments in Python begin with the # character.

True

Computer programs typically perform three steps: input is received, some process is performed on the input, and output is produced.

True

In Python, print statements written on separate lines do not necessarily output on separate lines.

True

Python allows programmers to break a statement into multiple lines.

True

The \t escape character causes the output to skip over to the next horizontal tab.

True

When using the camelCase naming convention, the first word of the variable name is written in lowercase and the first characters of all subsequent words are written in uppercase.

True


Set pelajaran terkait

Corresponding, alternate, and consecutive angles

View Set

Chapter 20 Electricity Vocabulary ( electric current and ohms law)

View Set

Real Estate 100 - Chapter 14 - Introduction to Taxation

View Set

OB Test 2 (Chps. 14, 18, 19, 21)

View Set

module 2 test - marketing research

View Set