Preview

01 - Programming Basics

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

  String

  Boolean

  Mod

  Integer and Float

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

  The weight of an orange in kilograms

  The precise length of a car in metres

  The age of a cat in whole months

  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

  if statements / while loop

  functions / boolean flag

  statements / if statements

  functional statements / if statement

 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

  Charles Babbage

  Alan Turing

  Bill Gates

  Jon Von Neumann

 5. In the following code, the output is '3030'. If you however, comment out line 2, then the output will be '60'. Can you explain why?

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

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

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

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

 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?

  string / float

  boolean / float

  float / boolean

  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 false!

  Statement 1 is true

  Both statements are 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.

  Assemblers

  Algorithms

  Tests

  Designs

 9. You can write algorithms in plain English before you decide which programming language you want to use. Writing algorithms this way is called _____________

  Plain Code

  Python Code

  Pseudocode

  Playcode

 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

  Abstraction

  Functional Programming

  Computational Thinking

  Decomposition