CIS 115 Midterm

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

7. A(n) variable keeps a running total. a. sentinel b. sum c. total d. accumulator

. accumulator

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

a. %

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

a. //

4. You a function to execute it. a. define b. call c. import d. export

b. call

2. A structure provides one alternative path of execution. a. sequence b. single alternative decision c. one path alternative d. single execution decision

b. single alternative decision

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

c. **

13. A bit that is turned off represents the following value: . a. 1 b. −1 c. 0 d. "no"

c. 0

20. This type of function returns either True or False. a. Binary b. true_false c. Boolean d. logical

c. Boolean

15. An extensive encoding scheme that can represent characters for many languages in the world is . a. binary numbering b. ASCII c. Unicode d. ENIAC

c. Unicode

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

c. string

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

d. #

3. A(n) expression has a value of either True or False. a. binary b. decision c. unconditional d. Boolean

d. Boolean

3. 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. algorithm

11. A byte is made up of eight . a. CPUs b. instructions c. variables d. bits 12. In the numbering

d. bits

2. A -controlled loop repeats a specific number of times. a. Boolean b. condition c. decision d. count

d. count

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

d. either single-quotes or double-quotes.

12. A variable that is visible to every function in a program file is a . a. local variable b. universal variable c. program-wide variable d. global variable

d. global variable

3. The first line of a function definition is known as the . a. body b. introduction c. initialization d. header

d. header

6. A is a diagram that gives a visual representation of the relationships between functions in a program. a. flowchart b. function relationship chart c. symbol chart d. hierarchy chart

d. hierarchy chart

6. This is a volatile type of memory that is used only for temporary storage while a program is running. a. RAM b. secondary storage c. the disk drive d. the USB drive

a. RAM

9. A compound Boolean expression created with the operator is true only if both of its subexpressions are true. a. and b. or c. not d. both

a. and

10. A(n) is a piece of data that is sent into a function. a. argument b. parameter c. header d. packet

a. argument

22. The translates an assembly language program to a machine language program. a. assembler b. compiler c. translator d. interpreter

a. assembler

10. A is enough memory to store a letter of the alphabet or a small number. a. byte b. bit c. switch d. transistor

a. byte

2. A design technique that helps to reduce the duplication of code within a program and is a benefit of using functions is . a. code reuse b. divide and conquer c. debugging d. facilitation of teamwork

a. code reuse

10. 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. comments

12. Validation loops are also known as . a. error traps b. doomsday loops c. error avoidance loops d. defensive loops

a. error traps

12. A _ is a Boolean variable that signals when some condition exists in the program. a. flag b. signal c. sentinel d. siren

a. flag

5. 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. flowchart

2. The physical devices that a computer is made of are referred to as . a. hardware b. software c. the operating system d. tools

a. hardware

2. A file that data is read from is known as a(n) . a. input file b. output file c. sequential access file d. binary file

a. input file

19. 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. input()

14. 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. operands

9. A video display is a(n) device. a. output b. input c. secondary storage d. main memory

a. output

4. The while loop is a type of loop. a. pretest b. no-test c. prequalified d. post-iterative

a. pretest

16. This standard library function returns a random floating-point number in the range of 0.0 up to 1.0 (but not including 1.0). a. random b. randint c. random_integer d. uniform

a. random

4. The symbols > < and == are all operators. a. relational b. logical c. conditional d. ternary

a. relational

8. A(n) is a special value that signals when there are no more items from a list of items to be processed. This value cannot be mistaken as an item from the list. a. sentinel b. flag c. signal d. accumulator

a. sentinel

24. The rules that must be followed when writing a program are called

a. syntax

5. The contents of this type of file can be viewed in an editor such as Notepad. a. text file b. binary file c. English file d. human-readable file

a. text file

5. A design technique that programmers use to break down an algorithm into functions is known as . a. top-down design b. code simplification c. code refactoring d. hierarchical subtasking

a. top-down design

16. Negative numbers are encoded using the technique. a. two's complement b. floating point c. ASCII d. Unicode

a. two's complement

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

a. variable

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

b. 17 = x

14. A set of 128 numeric codes that represent the English letters various punctuation marks and other characters is . a. binary numbering b. ASCII c. Unicode d. ENIAC

b. ASCII

19. This is a design tool that describes the input/ processing/ and output of a function. a. hierarchy chart b. IPO chart c. datagram chart d. data processing chart

b. IPO chart

19. If you were to look at a machine language program you would see . a. Python code b. a stream of binary numbers c. English words d. circuits

b. a stream of binary numbers

8. A component that collects data from people or other devices and sends it to the computer is called . a. an output device b. an input device c. a secondary storage device d. main memory

b. an input device

21. A magic number is . a. a number that is mathematically undefined b. an unexplained 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. an unexplained value that appears in a program's code

11. 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. assignment statement

6. The -= operator is an example of a(n) operator. a. relational b. augmented assignment c. complex assignment d. reverse assignment

b. augmented assignment

12. In the numbering system all numeric values are written as sequences of 0s and 1s. a. hexadecimal b. binary c. octal d. decimal

b. binary

6. This type of file contains data that has not been converted to text. a. text file b. binary file c. Unicode file d. symbolic file

b. binary file

25. A(n) program translates a high-level language program into a separate machine language program

b. compiler

1. A -controlled loop uses a true/false condition to control the number of times that it repeats. a. Boolean b. condition c. decision d. count

b. condition

20. In the part of the fetch-decode-execute cycle the CPU determines which operation it should perform. a. fetch b. decode c. execute d. deconstruct

b. decode

18. 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. str

b. float

20. 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. float()

17. Real numbers are encoded using the technique. a. two's complement b. floating point c. ASCII d. Unicode

b. floating point

9. GIGO stands for . a. great input, great output b. garbage in, garbage out c. GIGahertz Output d. GIGabyte Operation

b. garbage in, garbage out

13. When possible you should avoid using variables in a program. a. local b. global c. reference d. parameter

b. global

6. You use a(n) statement to write a single alternative decision structure. a. test-jump b. if c. if-else d. if-call

b. if

14. This is a prewritten function that is built into a programming language. a. standard function b. library function c. custom function d. cafeteria function

b. library function

8. A is a variable that is created inside a function. a. global variable b. local variable c. hidden variable d. none of the above; you cannot create a variable inside a function

b. local variable

8. and/ or/ and not are operators. a. relational b. logical c. conditional d. ternary

b. logical

4. Today, CPUs are small chips known as __________. a. ENIACs b. microprocessors c. memory chips d. operating systems

b. microprocessors

22. 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. named constant

10. A compound Boolean expression created with the operator is true if either of its subexpressions is true. a. and b. or c. not d. either

b. or

1. A file that data is written to is known as a(n) . a. input file b. output file c. sequential access file d. binary file

b. output file

11. A(n) is a special variable that receives a piece of data when a function is called. a. argument b. parameter c. header d. packet

b. parameter

7. The keyword is ignored by the Python interpreter and can be used as a placeholder for code that will be written later. a. placeholder b. pass c. pause d. skip

b. pass

1. A(n) is a set of instructions that a computer follows to perform a task. a. compiler b. program c. interpreter d. programming language

b. program

4. 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. pseudocode

15. This standard library function returns a random integer within a specified range of values. a. random b. randint c. random_integer d. uniform

b. randint

2. 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. software requirement

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

b. user

4. When a program is finished using a file it should do this. a. erase the file b. open the file c. close the file d. encrypt the file

c. close the file

1. A structure can execute a set of statements only under certain circumstances. a. sequence b. circumstantial c. decision d. Boolean

c. decision

8. When working with this type of file you can jump directly to any piece of data in the file without reading the data that comes before it. a. ordered access b. binary access c. direct access d. sequential access

c. direct access

5. A(n) structure tests a condition and then takes one path if the condition is true or another path if the condition is false. a. if statement b. single alternative decision c. dual alternative decision d. sequence

c. dual alternative decision

1. A group of statements that exist within a program for the purpose of performing a specific task is a(n) . a. block b. parameter c. function d. expression

c. function

7. You use a(n) statement to write a dual alternative decision structure. a. test-jump b. if c. if-else d. if-call

c. if-else

5. A(n) loop has no way of ending and repeats until the program is interrupted. a. indeterminate b. interminable c. infinite d. timeless

c. infinite

10. The integrity of a program's output is only as good as the integrity of the program's . a. compiler b. programming language c. input d. debugger

c. input

1. 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. logic

21. Computers can only execute programs that are written in . a. Java b. assembly language c. machine language d. Python

c. machine language

5. The computer stores a program while the program is running as well as the data that the program is working with in . a. secondary storage b. the CPU c. main memory d. the microprocessor

c. main memory

11. The _ operator takes a Boolean expression as its operand and reverses its logical value. a. and b. or c. not d. either

c. not

9. A(n) is the part of a program in which a variable may be accessed. a. declaration space b. area of visibility c. scope d. mode

c. scope

7. A type of memory that can hold data for long periods of time even when there is no power to the computer is called . a. RAM b. main memory c. secondary storage d. CPU storage

c. secondary storage

21. This is a math module function. a. derivative b. factor c. sqrt d. differentiate

c. sqrt

3. Each repetition of a loop is known as a(n) . a. cycle b. revolution c. orbit d. iteration

d. iteration

23. The words that make up a high-level programming language are called

d. keywords

3. Before a file can be used by a program it must be . a. formatted b. encrypted c. closed d. opened

d. opened

18. The tiny dots of color that digital images are composed of are called . a. bits b. bytes c. color packets d. pixels

d. pixels

11. The input operation that appears just before a validation loop is known as the . a. prevalidation read b. primordial read c. initialization read d. priming read

d. priming read

18. This statement causes a function to end and sends a value back to the part of the program that called the function. a. end b. send c. exit d. return

d. return

7. When working with this type of file you access its data from the beginning of the file to the end of the file. a. ordered access b. binary access c. direct access d. sequential access

d. sequential access

3. The part of a computer that runs programs is called . a. RAM b. secondary storage c. main memory d. the CPU

d. the CPU

17. This standard library function returns a random floating-point number within a specified range of values. a. random b. randint c. random_integer d. uniform

d. uniform


Kaugnay na mga set ng pag-aaral

Human Nutrition Chapter 10: Water Soluble Vitamins

View Set

LEED Green Associate Sample Exam Questions

View Set

PFLC INFORMÁTICA II Bloque 1 Algoritmos (respuestas sin acentos)

View Set