Programming Fundamentals
Introductory quiz covering basic programming concepts including data types, operators, control structures, subprograms, arrays, variables, constants, and Python syntax
Questions
DIV returns the
- Whole number of a multiplication
- Whole number of a division
- Remainder of a multiplication
- Remainder of a division
MOD returns the
- Whole number of a multiplication
- Whole number of a division
- Remainder of a multiplication
- Remainder of a division
Which of the following is used for selection?
- Top left
- Top right
- Bottom left
- Bottom right
Which of the following is a data type for True?
- Char
- Integer
- Boolean
- String
Which of the following is a data type for -23?
- Real
- Float
- Integer
- Char
Which of the following is a data type for "%"?
- Single string
- Alpha
- String
- Character
Which of the following is a data type for a decimal number?
- Real
- Number
- Integer
- Array
What is the difference between a function and a procedure?
- Function doesn't return a value, procedure returns a value
- Both return a value both are sub programs
- Procedure doesn't return a value, function returns a value
- Procedure allows the use of recursion
What is not a benefit of using a sub program?
- Allows the code to be reusable
- There is less chance of errors
- Less copying and pasting of similar code
- A lot more programming code
What best describes the construct sequencing?
- Programming code following a logical order
- Programming code that repeats
- Programming code performs an action based on a condition
- Programming code that assigns a value to a variable
What does an iteration allow?
- Check a condition
- Assign a variable
- Repeat a statement based on a condition
- Assign a variable several times
Which of the following is not an iteration?
- For
- While
- If
- Repeat Until
Which of the following is the correct syntax to set up an array?
- name = ["James", "Joe", "Jake", "Jamie"]
- name == ["James", "Joe", "Jake", "Jamie"]
- name = [James, Joe, Jake, Jamie]
- name = ["James" "Joe" "Jake" "Jamie"]
age = 16 and fave = "blue" which of the following statement is true?
- if (age == 16 AND fave == blue)
- if (age > "16" AND fave == "blue")
- if (age == "16" AND fave == "blue")
- if (age == 16 AND fave == "blue")
Identify from below a construct of iteration.
- print("hello world")
- name = input("Enter your name: ")
- if (age > 17)
- for i in range(0, 10)
You are programming to check if the age is greater than 18 identify the correct statement.
- if (age > "17")
- if (age > 17)
- if (age < 17)
- if ("age" > "17")
Identify from below a construct of selection.
- print("hello world")
- name = input("Enter your name: ")
- if (age > 17)
- for i in range(0, 10)
Which of following is not construct in procedural programming?
- Sequence
- Selection
- Iteration
- Object
Which of the following can hold multiple values?
- Variable
- Constant
- Array
- Definition
Which of the following is not a data type?
- Constant
- String
- Character
- Boolean
Which of the following is correct syntax for an input statement to store your name?
- name == input
- name = input("Enter your name: ")
- name == input("Enter your name: ")
- name = int(input("Enter your name: "))
Define what a constant is in programming
- A memory location.
- A memory store that you cannot change.
- A value.
- A memory store that you can change.
Which of the following is the correct syntax for an output statement in Python 3?
- print "Computer Science"
- output(Computer Science)
- print("Computer Science")
- print(Computer Science)
Define what a variable is in programming
- A memory location.
- A memory store that you cannot change.
- A value.
- A memory store that you can change.