CSC 401 Part 3
CSC 401 Part 3
• ALGOL
(ALGOrithmic Language) is one of several high level languages designed
specifically for programming scientific computations. It started out in the late
1950's, first formalized in a report titled ALGOL 58, and then progressed through
reports ALGOL 60, and ALGOL 68. It was designed by an international
committee to be a universal language. Their original conference, which took
place in Zurich, was one of the first formal attempts to address the issue of
software portability. . ALGOL's machine independence permitted the designers
to be more creative, but it made implementation much more difficult.
1
History of Some Programming Languages
• C#
Is one of the most popular programming languages developed by Microsoft, along
with the dot net framework development, which has been approved by ECMA-
334 and ISO. C# was designed to be general-purpose, high-level, fully object-
oriented, as well as a component-oriented programming language. Mr. Anders
Hejlsberg is the creator of this widely used programming language. The language
was based on C++ and Java, with additional extensions, libraries, and concepts
for implementing different OOPS and component-oriented programming
concepts.
2
History of Some Programming Languages
• Java
Java as a programming language was conceived in 1991 by a team of programmers
from sun Microsystems. This team comprised of James Gosling, Mike Sheridan
and Patrick Naughton. Initially the language was nicknamed “Oak” after a big
oak tree that stood outside James Gosling’s office, but the project was letter
renamed “Green;” and in 1995, it got its final name changed when it was
renamed Java after Java coffee.
3
Data Types
• Data type is classification of a particular type of information.
• Data types are essential to any computer programming
language.
• Without them, it becomes very difficult to maintain information
within a
Computer program.
• Different data types have different sizes in memory depending
on the machine and compilers.
4
Data Types
• Data Types
• •Integer
• •Floating-point
• •Character
• •String
• •Boolean
5
6
7
8
• String
• •String is a sequence of character.
• •Example:
• –Kuala Lumpur
• –John White
• –Computer
9
• Boolean
• •This data type only have two possible values:
• –True
• –False
• •Use this data type for simple flags that track true/false
conditions.
10
Data Structures
14
• A queue, on the other hand, is a list from which elements are
deleted from one end of the structure, called the front (this
operation is called dequeue), and new elements are added to
the other end, called the rear (this operation is called
enqueue).
• Consequently, a queue operates in a “first-in–first-out” (FIFO)
fashion—akin to a queue of customers served by a single teller
in a bank.
• Queues also have many important applications, including
several algorithms for graph problems.
15
Operators
• An operator in a programming language is a symbol that
tells the compiler to perform specific mathematical,
relational or logical operation and produce final result.
• Discussion on the concept of operators and the important
arithmetic and relational operators available in C, Java,
and Python will be provided.
16
Arithmetic Operators
• Computer programs are widely used for mathematical
calculations.
• Take a look at the following two examples −
17
The following table lists down a few of the important arithmetic operators
available in C programming language. Assume variable A holds 10 and
variable B holds 20, then −
18
Relational Operators
• Consider a situation where we create two variables and assign
them some values as follows −
• A=10
• B=20
• Here, it is obvious that variable A is greater than B in values.
• So, we need the help of some symbols to write such expressions
which are called relational expressions.
• If we use C programming language, then it will be written as
follows − (A>B)
19
• Here, we used a symbol > and it is called a relational
operator and in their
• Relational operators produce Boolean results which
means the result will be either true or false.
20
The following table lists down a few of the important relational
operators available in C programming language. Assume
variable A holds 10 and variable B holds 20, then −
21
• Example of C Programming which makes use of relational
operators in if conditional statement.,
• We use if statement to check a condition and if the
condition is true, then the body of if statement is
executed, otherwise the body of if statement is skipped.
22
Logical Operators
• Logical operators are very important in any programming
language and they help us take decisions based on certain
conditions.
• Suppose we want to combine the result of two conditions, then
logical AND and OR logical operators help us in producing the
final result.
• The following table shows all the logical operators supported by
the C language. Assume variable A holds 1 and variable B holds
0, then −
23
Logical Operators
24
25
26