100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary Cos 1521 Chapter 9-14 Exam Summaries

Rating
5,0
(1)
Sold
-
Pages
16
Uploaded on
06-05-2020
Written in
2019/2020

Hi Everyone, I hope that exam studying is going great for you. I compiled summaries from the textbook for each chapter so you dont need too. I work very hard on these and added multiple diagrams as well. I study at UNISA and I am not a huge fan of theory so this makes it easy for me to study just what is important and go into depth about it. Goodluck and all the best. I hope these help, they are totally worth it!

Show more Read less










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 6, 2020
Number of pages
16
Written in
2019/2020
Type
Summary

Content preview

Chapter 9 Programming Languages
To write a program for a computer, we must use a programming language. A computer language is a
set of predefined words that are combined into a program according to predefined rules.

Machine Languages

These are the programming languages available at an earlier stage. Made up of streams of 1’s and
0’s. The only language understood by the computer is machine language. Machine language has two
drawbacks. First, it is machine dependant. Second, it is very tedious to write programs in this
language and even more difficult to spot errors.

Assembly Languages

This is the next evolution, it replaces binary code with instructions and address with symbols or
mnemonics(also known as symbolic languages). An assembler is used to translate this into machine
language. Ex STORE Number1 RF means Store Register F into Number 1

High Level Languages

Assembly languages greatly improved programming efficiency but they still required programmers
to concentrate on the hardware they were using. There was a desire to improve efficiency and
change focus from the computer to the problem being solved. These are portable so the
programmer can focus on the program and not the computer. This language is easier for a human to
understand.




Translation

This is the method to convert higher level languages into machine language so that the computer
can understand the code. There are two types: compilers and interpreters.

- Compilers: translate the whole source program into the object program.

, - Interpreters: translates each line of the source program into the corresponding line of object
program and executing the line.




Translation Process:
- Lexical Analyzer: reads source code, symbol by symbol and creates a list of tokens in the
source language. Ex C, C++, Java
- Syntax Analyzer: Parses a set of tokens to follow instructions Ex
- Semantic Analyzer: Checks sentences created by the syntax analyser making sure of no
ambiguity.
- Code generator: Instructions are converted to a set of machine language instructions for the
computer

Programming Paradigms: Programming Languages approach they use to solve a problem




Procedural Paradigm: In the procedural paradigm (or imperative paradigm) we can think of a
program as an active agent that manipulates passive objects. We encounter man y passive objects in
our daily life: a stone, a book, a lamp, and so on. A passive object cannot initiate an action by itself,
but it can receive actions from active agents. A program in a procedural paradigm is an active agent
that uses passive objects that we refer to as data or data items. To manipulate a piece of data, the
active agent (program) issues an action, referred to as a procedure.

Examples: FORTRAN, COBOL, Pascal, C, Ada
- FORTRAN: Designed by a group of IBM engines under Jack Backus in 1957.

, - COBOL: Designed by a group of computer scientists under Grace Hopper of US Navy
- Pascal: Invented by Niklaus Wirth in 1971, named after Blaise Pascal
- C: Developed by Dennis Ritchie at Bell in 1970
- Ada: Named after Augusta Ada Byron, Assistance to Charles Babbage. Made for the US
Department of Defence

Object Oriented Paradigm: Deals with active objects instead of passive objects
- Classes are used to for a set of methods to react to outside stimuli
- Methods
- Inheritance
- Polymorphism: Meaning many forms. Treat several operations with the same name that can
do different things in related classes.
- Examples: C++ & Java
- C++: Bjarne Stroustup at Bell to improve C
- Java: Developed by Sun microsystems. Based on C & C++. Supports multithreading.

Functional Paradigm: Considered a mathematical function.
- Examples: LISP & Scheme
- LISP: Designed by a team of researchers at MIT in early 1960s.Everything is considered a list
- Scheme: a standardised version of LISP made by MIT in 1970s

Declarative Paradigm: Uses principle of logical reasoning to answer queries
- Based on deduction
- PROLOG is an example: Developed by A. Colmerauer in France 1972 Made up of facts &
Rules.

Common Concepts

- Identifiers: The name of objects.
- Data Types: A set of values and operations that can be applied to those values.
Simple: Cannot be broken into smaller data types. Have been defined in imperative
languages:
Integer – Whole number
Real – Number with fraction
Character – Symbol type
Boolean – True or false
Composite: Set of elements in which each element is a simple type or composite type:
Array: Set of elements each of the same type
Record: Set of elements in which element can be of different type

- Variables: The names for memory locations. (Initialization stores a value in a variable and
declaration sets a variable with a given name and type.
- Literals: A predetermined value used in a program
- Constants: A constant is similar to a variable but the value cannot be changed.
- Input:
- Output:
- Expressions: A sequence of operands and operators that reduce to a single value.

Operators(a language specific token that requires an action to be taken)

Reviews from verified buyers

Showing all reviews
5 year ago

5,0

1 reviews

5
1
4
0
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
examsummaries29 University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
11
Member since
5 year
Number of followers
11
Documents
8
Last sold
2 year ago

4,8

5 reviews

5
4
4
1
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions