Font size
Worksheets[TOPIC 1] Introduction to Programming
Total questions: 61
Worksheet time: 1hrs 1mins
Define programming language
Vocabulary and a collection of rules that command a computer, devices, applications to work according to the written codes
A set of words, abbreviations and symbols that enables a programmer to give instructions to a computer.
a series of instructions that directs a computer to perform tasks.
Identify the type of programming language used to write Segment 1.
Low Level Language
High Level Language
Machine Language
Assembly Language
Which of the following is not a high level programming language?
Assembly
C++
Java
Machine Language
Identify and state the type of translator that translate the Program A to Program B.
Assembler
Compiler
Interpreter
Identify type of Translator A
Assembler
Compiler
Interpreter
What is a programming paradigm?
Steps by step instruction, the programmer should follow to solve a problem
Steps to programming the solution of problem
Both a method of problem solving and an approach to programming language design
Identify the type of programming paradigm in Figure 5 (i).
Logic
Object-Oriented
Procedural
Based on statement given, identify type of programming paradigm.
Procedural
Object-Oriented
Logic
The first step in solving a problem is:
Develop a solution
Reflect and review
Understand the problem
Investigate and research the problem
Which paradigm makes use of methods and attributes to encapsulate data in classes.
Declarative
Imperative
Object oriented
Low level
Which paradigm offers the least amount of abstraction and is machine dependent?
Declarative
Imperative
Object oriented
Low level
1. What is a programming paradigm?
Steps of solving a problem
Steps to programming
Steps to a programming language
Both a method of problem solving and an approach to programming language design
Which is NOT a programming paradigm:
Imperative
Declarative
Object Oriented
Logic
Java
Allow programmers to write instructions using numeric codes and memory addresses.
Object-Oriented Design (OOD)
Low-level languages
Object-oriented Programming (OOP)
Portable or platform-independent
Approach to program design that identifies how objects must interact with each other in order to solve problems
Console
Object-Oriented Design (OOD)
Portable or platform-independent
Windowed
Term to indicate that a program can be run on a variety of platforms
Console
Windowed
Portable or platform-independent
Applet
A method that focuses on telling a computer what to do to reach a certain objective. It takes a linear, top-down approach to solving problems by creating routines and subroutines that perform computations.
Programming Paradigm
Procedural Programming
Declarative Programming
Object-Oriented Programming (OOP)
A programming paradigm based on the concept of objects which can contain both data and programming code.
Declarative Programming
Object-Oriented Programming (OOP)
Encapsulation
Version Control Systems (VCS)
What is the Prolog programming language known for?
Prolog is known for its use in web development and design.
Prolog is known for its use in agriculture and farming.
Prolog is known for its use in fashion and clothing design.
Prolog is known for its use in artificial intelligence and computational linguistics.
What are the limitations of Prolog programming language?
Prolog has no limitations
Prolog is standardized and easy to debug
Prolog has limitations such as inefficiency in handling large databases, lack of standardization, and difficulty in debugging complex programs.
Prolog is highly efficient in handling large databases
How are problems typically solved in logical programming?
Through explicit sequences of commands
By defining rules and facts, and querying the system
Using class hierarchies and inheritance
By direct manipulation of memory addresses
Which of the following is a characteristic of logical programming languages?
Imperative execution
Object orientation
Rule-based execution
Sequential flow of control
(a) Given these four programming languages – C#, FORTRAN, Java and Prolog.
Identify programming language that using object oriented paradigm style?
note : if the answer is more than 1 separate it using comma ( , )
(a)
(a) Given these four programming languages – C#, FORTRAN, Java and Prolog.
Identify programming language that using procedural paradigm style?
note : if the answer is more than 1 separate it using comma ( , )
(a)
Which of the following describe procedural programming paradigm correctly?
organizes the program code into procedures (or functions or methods).
uses classes and objects to create models based on the real world environment.
uses automated reasoning to compute over a set of facts and rules.
easy to maintain and modify existing code as new objects are created inheriting characteristics from existing ones.
Program code is written using logic notation
State the advantages of procedural programming (choose 1-4 answers)
Identify disadvantages of Object Oriented Languages (Choose 1 - 4 answers)
What is the main advantage of using high-level languages over low-level languages?
High-level languages offer direct control of hardware
High-level languages remove the detail of memory addressing
High-level languages have direct access to hardware
Low-level languages have a one-to-one mapping with machine code instructions
Which programming paradigm is primarily concerned with the flow of control?
Functional programming
Logical programming
Object-oriented programming
Procedural programming
What is the main advantage of low-level languages?
They offer direct control of hardware
They remove the detail of memory addressing
They have direct access to hardware
They have a one-to-one mapping with machine code instructions
Which type of programming paradigm organizes software design around data, or objects, rather than functions and logic?
Object-oriented programming
Logical programming
Functional programming
Procedural programming
What is the purpose of assembly code in relation to machine code?
It is used to write code using mathematical expressions
It is the step above high-level languages
It is the binary representation of an instruction
It represents machine code instructions using mnemonics
Which programming paradigm is used to solve programming problems using a specific knowledge base?
Functional programming
Logical programming
Object-oriented programming
Procedural programming
Translates low level assembly language mnemonic into machine code
Assembler
Compiler
Interpreter
Program is translated line by line as the program is running
Assembler
Compiler
Interpreter
Translates source code from high level languages into object code and then into machine code
Assembler
Compiler
Interpreter
Which of the following is NOT a translator?
Assembler
Compiler
Interpreter
Executer
Convert programming source code into language that the computer processor can understands.
Programming Language
Programming Paradigm
Language Translator
Procedural
Which of these is incorrect machine language
Machine dependent –
which cannot run on different types of computers and operating system.
Need translator to convert to
low-level language
Difficult to learn, modify and far to human languages.
Consists of binary digits or English – like abbreviations to form instruction
Which one of these can not be called source code.
Java
Python
Visual Basic
Android
Which generation of computer languages used the LOAD, ADD and STORE codes,
First
Second
Third
Fourth
Which programming language can be translated by a Compiler?
C
Machine language
Ruby
JavaScript
Which programming language can be translated by an Interpreter?
Machine language
Perl
PHP
Cobol
What type of translator translates a program from its original language into machine code by converting the entire source program into machine language at one time?
Interpreter
Linker
Assembler
Compiler
The following are programming paradigms:
Java, C++, Pascal
Procedural, object-oriented , Logic
High Level Language, Low Level Language
Example of programming that use Logic paradigm
BASIC
ASP
JAVA
PYTHON
LOAD r2,
ADD r1,
DIV r1, #2
Identify the generation of programming language that uses the program above:
First Generation
Second Generation
Third Generation
Fourth Generation
This translator will stop program execution immediately if it finds a line of source code that results in an error
Compiler
Interpreter
Which translator does not produce object code and is needed every time the code is translated?
(a)
In general, compiled code is easier to debug than interpreted code.
True
False
You do not get access to the source code with compiled code.
True
False
What does IDE stand for?
Internal Development Environment
Integrated Design Environment
Internal Design Environment
Integrated Development Environment
If a program written in assembly language uses 400 lines of code, how many lines of machine code will there be?
200
400
800
Why are translators necessary?
check all that apply
Translators convert high-level languages into machine code
Computers can only understand machine code
so that programmers could write using high-level languages
Which creates an executable file that can then be used independently of the original source code.
Compiler
Interpreter
Which translates and executes each line of code during runtime
Compiler
Interpreter
'It is a low-level language'
Note: A statement may apply to more than one type of programming language.
High-level
language
Assembly
language
Machine
code
