Search Header Logo
Types of Programming Languages + Paradigms

Types of Programming Languages + Paradigms

Assessment

Presentation

Computers

11th - 12th Grade

Practice Problem

Easy

Created by

Ronan McStravick

Used 5+ times

FREE Resource

27 Slides • 21 Questions

1

Object Orientated Programming

Tuesday 26 January 2021

Slide image

2

High Level Languages

Most computer languages are written in high-level programming languages

3

High Level Programming Languages

  • Commands in a high-level language look very like English. For example:

  • print()

  • SELECT * FROM Users:

4

Fill in the Blank

High Level Languages (HLLs) include most programming languages such as

5

HLLs continued

  • They are made of human-readable statements that make it easier for us to program

  • They are PORTABLE, which means they can be run on many different types of hardware

6

Multiple Choice

Computers can only process instructions in the form of binary numbers. So we use special software to conver our HLL source into executable binary files - These are known as....

1

IDLE

2

Resistors

3

Translators

4

Drivers

7

Fill in the Blank

HLL's are made of _________-readable statements that make it easier for us to program.

8

Multiple Choice

Which of these look like HLL's statements?

1

CMP ch, dh

2

x = 30

3

MOV ax, bx

9

Low Level Languages (LLL's)

These are more closer to executable machine code than high-level languages.

LLL's are harder to read by humans, but are easier to read for computers.

10

Multiple Select

LLL commands are not easy to read and might include commands such as

1

print (x)

2

SELECT name FROM list

3

CLI

4

MOV ax, bx

11

Why do we use LLL's?

They provide exact control over the CPU


LLL's need less translation, and often lead to faster code which is useful for computers with low specifications such as embedded systems.

12

Fill in the Blank

LLL's produce shorter and faster code which is useful for computers with low SP_C_____T___S, especially in embedded systems.

13

Multiple Choice

What does it mean for a language to be portable?

1

The computer it runs on can be moved

2

It can only be run on mobile devices

3

It can run on different types of hardware

14

Programming Paradigms

Tuesday 26 January 2021

15

Programming Paradigms

  • A programming paradigm is a way of coding to solve a problem.

  • We have 4 types of paradigm and each one is geared towards certain types of situations.

  • Within each paradigm there are many different programming languages that all offer different things to each other.

  • Some programming languages can be used for more than one paradigm.

16

Procedural Programming

  • Procedural programming is the most common paradigm of programming language.

  • Procedural languages have built in simple data types like string, char, boolean, int and real.

  • Procedural languages focus on a set of instructions that are followed through to achieve a desired outcome at the end.

  • Python is foremost a procedural language.

17

Object Orientated Programming (OOP)

  • Object orientated programming came about as developers needed to model real world items that could be copied over and over again but given different attributes.

  • An object “class” is set up and shows the attributes (such as colour of a car) and its behaviours (such as engine_start), this class is a blueprint for creating an object.

  • Once a class is defined, it can be reused to create “instances” of the object as many times as the developer needs.

  • Java and Python are object orientated languages.

18

Declarative programming

  • Declarative languages use statements to describe a problem to be solved instead of how to solve the problem.

  • The statements are given to the programming language engine, it then figures out how to solve the problem and return a result.

  • SQL is a declarative language.


19

Functional programming

  • In functional programming, functions (not procedures) are the blocks we build programs out of.

  • Functions are different to procedures as they have to follow set rules:

  • They must take in valid inputs, return an output, and not have any side effects.

  • Haskell and Python are examples of languages that can be functional languages.

20

Multiple Choice

Which of the following is an example of a declarative language?

1

Python

2

Assembly

3

Java

4

SQL

21

Fill in the Blank

Examples of functional programming languages are PYTHON and what?

22

Procedural Programming Languages

  • Procedural languages are the most common type of programming language.

  • Procedural languages have become more popular.

  • Procedural languages now have many libraries of pre-compiled code to use. This speeds up the programming process.

23

Fill in the Blank

N__F___ uses the python programming langage to manage their systems (CLUE: You watch movies/series on this)

24

Data types and structures

  • Procedural languages have built in basic data types such as strings, integers, real numbers, boolean and char.

  • Procedural languages also have advanced data structures such as arrays, stacks and queues.

25

Procedures

  • Procedural language programs are built up of procedures that perform an action.

  • The procedures are reusable and make it quicker to program.

26

Multiple Choice

What property of procedures makes them beneficial for programmers?

1

Procedures are easy to code

2

Procedures are reusable

3

Procedures run quickly

4

Procedures are not CPU intensive

27

Fill in the Blank

Procedural languages now feature many L________ of pre-compiled code to use.

28

Prcoedural Languages continued...

  • Procedural languages focus on a set of instructions that are followed through to achieve a desired outcome at the end.

29

Open Ended

Name five data types supported by procedural programming...

30

Multiple Select

Which of the following are properties of procedural programming?

1

Objects

2

Data Types

3

Instructions

4

Statements

31

Open Ended

Netflix use the python programming language to manage their systems. Python is a procedural programming language.


Name the programming paradigms:

32

Object Orientated Languages (OOL's)

33

Object-oriented programming

  • Object-oriented programming allows us to model real-world objects and manipulate them easily.

  • In object-oriented programming, most real-world objects, like cars, can be modelled.

  • Each object is an instance of the class. Objects contain:

  • Attributes: things we store about them e.g. the make and model of the car.

  • Methods: things the object can do e.g. starting the engine or indicating to turn.

34

Classes

  • A class forms a blueprint that we can use to instantiate (create) an object.

  • A car class could be instantiated for every car ever made.

  • Each object would have the same behaviours, but slightly different values in their attributes.



35

Inheritance

  • We can define a subclass from what we call the 'super class'.

  • These are sometimes known as child class and parent class.

  • In inheritance, the subclass inherits all of the attributes and methods of the superclass.

  • The subclass can have its own attributes and methods.

36

Example

  • If we had a vehicle super class, we could have a subclass of car that would inherit all of the attributes and methods of the vehicle class.

  • The car subclass could add additional attributes such as colour and methods such as indicate_left that do not apply to the vehicle super class.


37

Multiple Choice

Which of the following is true of inheritance?

1

Superclass inherits only the methods of the subclass

2

Subclass inherits all of the attributes and methods of the superclass

3

Subclass inherits only the methods of the superclass

4

Superclass inherits all of the attributes and methods of the subclass.

38

Open Ended

Name two properties contained in objects:

39

Classes

A class is a blueprint for creating objects.

40

What is a class?

  • A class is a blueprint for creating an object.

  • One class will often represent one type of real-world object.

  • For example: in a snooker game you might have a 'Ball' class.

41

What is inside a class?

  • A class contains two main components:

  • Attributes: these are variables which describe the object.

  • Methods: these are subroutines which allow the object to perform actions.

42

Classes in Java



  • Classes have different levels of visibility.

  • In Java, classes are created using the class keyword.

  • These classes can be made public (can be used in any part of the program) using the public class keywords.

43

The image here shows a Java class. here

Slide image

44

Fill in the Blank

A P_B___ class can be used in any part of the program.

45

Multiple Choice

Which keyword is used to create a class in Java?

1

cls

2

object

3

keyword

4

class

46

Multiple Select

Which of the following properties would be attributes of a cat class?

1

Fur length

2

Meow

3

Fur colour

4

Age

5

Purr

47

Fill in the Blank

A public class is created by typing: ______ class ...

48

Stop here - We will continue with OOL's in tomorrow's lesson.

Thank you for your hard work - Please make sure to submit your SLR7 work and watch the second OOL video before tomorrow.

Object Orientated Programming

Tuesday 26 January 2021

Slide image

Show answer

Auto Play

Slide 1 / 48

SLIDE