WorksheetsTest 1 Programming principles
Total questions: 68
Worksheet time: 2hrs 14mins
Which contains the physical devices that make up a computer?
Hardware
CPU
Main memory
Input device
Output device
Which is contained in the "box" of the computer?
Hardware
The central processing unit (CPU)
The main memory
Secondary storage devices
Paloma
Which of these includes (disc drives, CDs, DVDs, etc.)
Paloma
Perro
Main memory
Secondary storage devices
The central processing unit (CPU)
Which of these collects data people or other devices to use in the computer program that is running. Types include keyboards, mouse, scanner, microphone, digital cameras. Discs and optical drives can also be used as "input" as they hold the data being used in a computer program.
Input devices
Output devices
The central processing unit (CPU)
Hardware
Main Memory
Which of these devices are those that produce data and information for people or other devices, Printers and display units, plus discs and CDs, DVDs are output as well.
Input devices
Output devices
Main memory
The central processing unit(CPU)
Hardware
Which type of programing language is a programming language that is designed to be easy for humans to read and write. Ex. Java, JavaScript, Python.
High-level languages
Low-level languages
Which type is a programming language that is designed to be easy for a computer to run; are hardware dependent.
High-level language
Low-level language
What are 3 examples of low-level languages?
machine language
assembly language
bytecode
Python
Java
What are the two computer programs that translate high-level languages into machine language?
Python
Java
Interpreters
Compilers
C++
Which translates the entire source code completely before the program starts running?
Compiler
Interpreter
Python
Java
C++
Which translates a few lines at a time, runs those lines, and then alternates between translating source code and running the results.
Compiler
Interpreter
Python
Java
C++
Which of these are the rules you must follow when create the names of your variables?
You can't use one of PYTHON's keywords
A variable name cannot contain spaces
The first letter MUST be one of the letters A-Z, a-z or the underscore (_) character
After the first letter you may use the letters A-Z, a-z, digits 0-9 or the underscore
Uppercase and lowercase characters are DIFFERENT. This means the variable name Age and age are NOT the same!!!
There are only two values for a Boolean data type variable - True and False. Is this statement correct?
Yes
No
Which is is a logical design of statements that controls the order in which a set of statements execute?
Control structure
Sequence structure
A decision/selection structure
None of the above
All of the above
Which structure is a set of statements that execute in the order that they appear?
Control structure
Sequence structure
A decision/selection structure
All of the above
None of the above
The purpose of the CPU is to retrieve memory and execute it.
True
False
Which are typical major components for a computer?
Central processing unit
Main memory
Secondary storage devices
Input and output devices
Ram
All data in a computer is stored in sequences of 0s and 1s.
True
False
Which of these is a line of code that performs a basic operation?
Statement
Method
Class
Package
Comment
Which of these is a named sequence of statements; should begin with lower case letters?
Statement
Method
Class
Package
Comment
Which of these is a named collection of methods; should begin with upper case letters.
Statement
Method
Class
Package
Comment
Which of these is a named collection of methods; should begin with upper case letters?
Statement
Method
Class
Package
Comment
Which of these are called notes to yourself and other programmers in the source code?
Statement
Method
Class
Package
Comment
Which of these are considered input devices?
Keyboard
Mouse
Scanner
Camera
Car
Which of these are considered output devices?
Printer
Video display
Car
Keyboard
Mouse
Which of these are programs that make a computer useful for everyday tasks?
Application software
System software
Ram
The central processing unit (CPU)
Data software
Which of these is a set of instructions that a computer follows to perform a task?
Program
RAM
The central processing unit (CPU)
Software
Car
What is a set of well-defined logical steps that must be taken to perform a task called?
Algorithm
Pseudocode
Flowchart
Input
Output
What would fake code be called?
Package
Pseudocode
Strings
Bug
Syntax error
What is a diagram that graphically depicts the steps in a program called?
Flowchart
Line chart
Piechart
Collum chart
Area chart
What is the first step in the program development life cycle?
Design the program
Write the code
Interpret or compile your program
Execute/Run the program
Correct logic errors
What is the second step in the program development cycle?
Design the program
Write the code
Interpret or compile your program
Execute/Run the program
Correct logic errors
What is the third step in the program development cycle?
Design the program
Write the code
Interpret or compile your program
Execute/Run the program
Correct logic errors
What is the fourth step in the program development cycle?
Design the program
Write the code
Interpret or compile your program
Execute/Run the program
Correct logic error
What is the fifth step in the program development cycle?
Design the program
Write the code
Interpret or compile your program
Execute/Run the program
Correct logic errors
What is a piece of prewritten code that performs an operation?
Function
Print function
Argument
Paloma
Perro
A sequence of characters that is used as data?
True
False
A string literal is a string that appears in actual code of a program.
True
False
Comments are notes of explanation within a program.
True
False
An end-line comment appears at the end of a line of code.
True
False
What is the name that represents a value stored in the computer memory?
Variable
Statement
Comment
Value
Data
What is data given to a function called?
Argument
Variable
Statement
Perro
String literal must be enclosed in single (‘) or double (“) quote marks
True
False
What is used to create a variable and make it reference data?
Assignment statement
Beginning statement
Comment statement
Which is used for the assignment operator?
The equal sign (=)
quotations("")
A plus sign (+)
Two backslashes (//)
A minus sign (-)
In the assignment statement, the variable receiving value must be on the left side.
True
False
A variable can refer to item of any type.
True
False
A garbage collection is the removal of values that are no longer referenced by variables.
True
False
Which type of structure is the logical design that controls the order in which a set of statements execute?
Control structure
Sequence structure
Decision structure
Single alternative decision structure
Single structure
Which structure is a set of statements that executes in the order they appear?
Control structure
Sequence structure
Decision structure
Single alternative decision structure
Single structure
Which of these are expressions that evaluate to either true or false based on a comparison between two or more values. These expressions are used in if statements as well as in looping statements?
Boolean expressions
Conditional expressions
Integral expressions
Floating expressions
Primary expressions
Which operator determines whether a specific relationship exists between two values?
Arithmetic Operators
Bitwise Operators
Identity Operators
Rational Operators
Membership Operators
This would be true in Boolean expressions using rational operators for X being greater than y?
x > y
x < y
x >= y
x <=y
x == y
This would be true in Boolean expressions using rational operators for x is less than y?
x > y
x < y
x >= y
x <= y
x == y
This would be true in Boolean expressions using rational operators for x is greater than or equal to y?
x > y
x < y
x >= y
x <= y
x != y
This would be true in Boolean expressions using rational operators for x is less than or equal to y?
x > y
x < y
x >= y
x <= y
x != y
This would be true in Boolean expressions using rational operators for x is equal to y?
x > y
x < y
x >= y
x <= y
x == y
This would be true in Boolean expressions using rational operators for x is not equal to y?
x > y
x < y
x >= y
x >= y
x != y
When the if the statement executes, the condition is tested, and if it is true the block statements are executed. otherwise, block statements are skipped.
True
False
>= and <= operators test more than one relationship.
True
False
== the operator determines whether the two operands are equal to one another.
True
False
!= the operator determines whether the two operands are not equal.
True
False
Statements in an inner block must be indented with respect to the outer block.
True
False
What is data values that can change when the user is asked a question called?
Variables
Strings
Comment
Class
Package
What is a programing error that causes it to operate incorrectly but not to terminate abnormally (Crash)
Logic error
Syntax error
Valueerror Error
Typeerror Error
TypeError
What is a group of statements within a program that performs a specific task called?
Function
Progarm
Statement
Block
Header
What is this program called where each task in a program is its own function?
Modularized program
Python Program
Java Program
C++ Program
None of the above
What type of function simply executes the statements it contains and then terminates called?
Void function
value-returning functions
Built in functions
Main Function
Function header
