Exam 1

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

A _____ is a name that references a value in the computer's memory. a. variable b. register c. RAM slot d. byte

a

A _________ is a diagram that graphically depicts the steps that take place in a program. a. Flowchart b. Step chart c. Code graph d. Program graph

a

In the expression 12 + 7, the values on the right and left of the + symbol are called ____ a. operands b. operators c. arguments d. math expressions

a

Short notes placed in different parts of a program explaining how those parts of the program work are called ______ a. comments b. reference manuals c. tutorials d. external documentation

a

This operator performs division, but instead of returning the quotient it returns the remainder. a. % b. * c. ** d. /

a

Which built-in function can be used to read input that has been typed on the keyboard? a. input() b. get_input() c. read_input() d. keyboard()

a

. This is an operator that raises a number to a power a. % b. * c. ** d. /

c

A ______ error does not prevent the program from running, but causes it to produce incorrect results. a. Syntax b. Hardware c. Logic d. Fatal

c

A _______ is a sequence of characters a. char sequence b. character collection c. string d. text block

c

A string literal in Python must be enclosed in ______ a. parentheses b. single-quotes c..double-quotes d. either b or c

d

A(n) _______ is a set of well-defined logical steps that must be taken to perform a task. a. Logarithm b. Plan of action c. Logic schedule d. Algorithm

d

This symbol marks the beginning of a comment in Python a. & b. * c. ** d. #

d

Write a Python statement that subtracts the variable down_payment from the variable total and assigns the result to the variable due.

due = total - down_payment

What would be the following display? amount = 72 amount = 7 print(amount)

7

Write Python code that prompts the user to enter his or her age and assigns the user's input to a variable named age.

Ans: age = int(input("Enter your age: "))

(True/False)If you print a variable that has not been assigned a value, the number 0 will be displayed.

False

(True/False)Variable names can have spaces in them.

False

True/False) programmers must be careful not to make syntax errors when writing pseudocode programs.

False

Is the variable name Amount the same as amount?

NOT the same

what would the following code display? val = 99 print("The value is ", 'val')

The value is val

(True/False)In Python, the first character of a variable name cannot be a number.

True

True/False) In a math expression, multiplication and division take place before addition and subtraction.

True

. This operator performs integer division a. // b. % c. ** d. /

a

. A ____________ is a name that represents a value that does not change during the program's execution. a. named literal b. named constant c. variable signature d. key term

b

A ________ is any hypothetical person using a program and providing input for it. a. designer b. user c. guinea pig d. test subject

b

A magic number is _______ a. a number that is mathematically undefined b. an unexpected value that appears in a program's code c. a number that cannot be divided by 1 d. a number that causes computers to crash

b

A(n) ______ makes a variable reference a value in the computer's memory. a. variable declaration b. assignment statement c. math expression d. string literal

b

A___________ is a single function that the program must perform in order to satisfy the customer. a. Task b. Software requirement c. Prerequisite d. Predicate

b

An informal language that has no syntax rules and is not meant to be compiled or executed is called _________. a. Faux code b. Pseudocode c. Python d. A flowchart

b

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? a. int b. float c. currency d. string

b

Which built-in function can be used to convert an int value to a float? a. int_to_float() b. float() c. convert() d. int()

b

Which of the following statements will cause an error? a. x = 17 b. 17 = x c. x = 99999 d. x = '17'

b

Is the following assignment statement valid or invalid? 72 = amount

invalid


संबंधित स्टडी सेट्स

Segment 1 Midterm Review (Earth and Space Science)

View Set

1.3 - Democracy in the United States

View Set

Chapter 26. Nutrition and Metabolism

View Set

MGT 402 Leadership in Organizations Final

View Set

CISSP PRACTICE TESTS Chapter 6 ▪ Security Assessment and Testing ( Domain 6)

View Set

Chapter 37- Thyroid and Parathyroid Agents

View Set