Preview

01 - Programming Basics

 1. Understanding data types is very important in programming. Which of the following is NOT a valid datatype?

  Boolean

  String

  Mod

  Integer and Float

 2. Which item would be best represented using an 'integer' data type?

  The age of a cat in whole months

  The precise length of a car in metres

  The weight of an orange in kilograms

  An email address

 3. The diagram below shows the three famous programming constructs: Sequence, Selection and Iteration. An example of Selection is the use of _______________ and an example of Iteration would be the use of a _______________
uploads/3constructs.jpg

  functional statements / if statement

  if statements / while loop

  functions / boolean flag

  statements / if statements

 4. This man is the inventor of the famous analytical engine and is often called the "Father of the computer". What is his name?
uploads/800px-Charles_Babbage_-_1860.jpg

  Alan Turing

  Charles Babbage

  Bill Gates

  Jon Von Neumann

 5. In the following code, the output is '3030'. If you however, uncomment (remove the #) line 2 (so that the line runs), then the output will be '60'. Can you explain why?

  Line 2 converts the age into a whole number that is divided by itself

  Line 2 converts the string variable 'age' into an integer and so the addition on line 3 works

  Line 2 de-converts the string to a non-string value, so that the calculations works

  Line 2 converts an integer age into string, so that the string can be added to itself

 6. A big supermarket is making a database to store its food and ingredients. e.g. Weight(Kg) = 1.54; Quantity in Stock= 6; Gluten-Free=False. What is the most appropriate data type for the Weight and Gluten_Free variables?

  boolean / float

  float / boolean

  string / float

  float /string

 7. Programming languages can fall in one of two categories. Low or High level. Which of the following statements is true?
Statement 1

Languages are described as high level or low level. Low-level languages, 
such as assembly language, more closely reflect the mechanical workings of the 
CPU. High-level languages include Java, JavaScript, C++, Ruby, BASIC or Python,
while low-level languages include assembly language, and machine code.

Statement 2

Languages are described as high level or low level. Low-level languages, 
such as python, more closely reflect the mechanical workings of the CPU. 
High-level languages include assembly language, and machine code.
while low-level languages include Java, JavaScript, C++, Ruby, BASIC or Python.

  Both statements are true ...

  Both statements are false!

  Statement 1 is true

  Statement 2 is true

 8. ____________ are sets of step-by-step instructions for the computer to follow. They are at the heart of all computer programs.

  Designs

  Tests

  Assemblers

  Algorithms

 9. _____________ is a readable description of what a computer program will do. It is not programming language specific. For instance, you could write instructions in what resembles plain English.

  Pseudocode

  Playcode

  Python Code

  Plain Code

 10. _________________is one of the four cornerstones of Computer Science. It involves breaking down a complex problem or system into smaller parts that are more manageable and easier to understand
uploads/ProblemSolving05.jpg

  Computational Thinking

  Abstraction

  Functional Programming

  Decomposition