Programming Fundamentals

Introductory quiz covering basic programming concepts including data types, operators, control structures, subprograms, arrays, variables, constants, and Python syntax

35 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

DIV returns the

  1. Whole number of a multiplication
  2. Whole number of a division
  3. Remainder of a multiplication
  4. Remainder of a division
Question 2 Multiple Choice (Single Answer)

MOD returns the

  1. Whole number of a multiplication
  2. Whole number of a division
  3. Remainder of a multiplication
  4. Remainder of a division
Question 3 Multiple Choice (Single Answer)

Which of the following is used for selection?

  1. Top left
  2. Top right
  3. Bottom left
  4. Bottom right
Question 4 Multiple Choice (Single Answer)

Which of the following is a data type for True?

  1. Char
  2. Integer
  3. Boolean
  4. String
Question 5 Multiple Choice (Single Answer)

Which of the following is a data type for -23?

  1. Real
  2. Float
  3. Integer
  4. Char
Question 6 Multiple Choice (Single Answer)

Which of the following is a data type for "%"?

  1. Single string
  2. Alpha
  3. String
  4. Character
Question 7 Multiple Choice (Single Answer)

Which of the following is a data type for a decimal number?

  1. Real
  2. Number
  3. Integer
  4. Array
Question 8 Multiple Choice (Single Answer)

What is the difference between a function and a procedure?

  1. Function doesn't return a value, procedure returns a value
  2. Both return a value both are sub programs
  3. Procedure doesn't return a value, function returns a value
  4. Procedure allows the use of recursion
Question 9 Multiple Choice (Single Answer)

What is not a benefit of using a sub program?

  1. Allows the code to be reusable
  2. There is less chance of errors
  3. Less copying and pasting of similar code
  4. A lot more programming code
Question 10 Multiple Choice (Single Answer)

What best describes the construct sequencing?

  1. Programming code following a logical order
  2. Programming code that repeats
  3. Programming code performs an action based on a condition
  4. Programming code that assigns a value to a variable
Question 11 Multiple Choice (Single Answer)

What does an iteration allow?

  1. Check a condition
  2. Assign a variable
  3. Repeat a statement based on a condition
  4. Assign a variable several times
Question 12 Multiple Choice (Single Answer)

Which of the following is not an iteration?

  1. For
  2. While
  3. If
  4. Repeat Until
Question 13 Multiple Choice (Single Answer)

Which of the following is the correct syntax to set up an array?

  1. name = ["James", "Joe", "Jake", "Jamie"]
  2. name == ["James", "Joe", "Jake", "Jamie"]
  3. name = [James, Joe, Jake, Jamie]
  4. name = ["James" "Joe" "Jake" "Jamie"]
Question 14 Multiple Choice (Single Answer)

age = 16 and fave = "blue" which of the following statement is true?

  1. if (age == 16 AND fave == blue)
  2. if (age > "16" AND fave == "blue")
  3. if (age == "16" AND fave == "blue")
  4. if (age == 16 AND fave == "blue")
Question 15 Multiple Choice (Single Answer)

Identify from below a construct of iteration.

  1. print("hello world")
  2. name = input("Enter your name: ")
  3. if (age > 17)
  4. for i in range(0, 10)
Question 16 Multiple Choice (Single Answer)

You are programming to check if the age is greater than 18 identify the correct statement.

  1. if (age > "17")
  2. if (age > 17)
  3. if (age < 17)
  4. if ("age" > "17")
Question 17 Multiple Choice (Single Answer)

Identify from below a construct of selection.

  1. print("hello world")
  2. name = input("Enter your name: ")
  3. if (age > 17)
  4. for i in range(0, 10)
Question 18 Multiple Choice (Single Answer)

Which of following is not construct in procedural programming?

  1. Sequence
  2. Selection
  3. Iteration
  4. Object
Question 19 Multiple Choice (Single Answer)

Which of the following can hold multiple values?

  1. Variable
  2. Constant
  3. Array
  4. Definition
Question 20 Multiple Choice (Single Answer)

Which of the following is not a data type?

  1. Constant
  2. String
  3. Character
  4. Boolean
Question 21 Multiple Choice (Single Answer)

Which of the following is correct syntax for an input statement to store your name?

  1. name == input
  2. name = input("Enter your name: ")
  3. name == input("Enter your name: ")
  4. name = int(input("Enter your name: "))
Question 22 Multiple Choice (Single Answer)

Define what a constant is in programming

  1. A memory location.
  2. A memory store that you cannot change.
  3. A value.
  4. A memory store that you can change.
Question 23 Multiple Choice (Single Answer)

Which of the following is the correct syntax for an output statement in Python 3?

  1. print "Computer Science"
  2. output(Computer Science)
  3. print("Computer Science")
  4. print(Computer Science)
Question 24 Multiple Choice (Single Answer)

Define what a variable is in programming

  1. A memory location.
  2. A memory store that you cannot change.
  3. A value.
  4. A memory store that you can change.