Professional Documents
Culture Documents
Week1 L1 Introduction
Week1 L1 Introduction
Week1 L1 Introduction
Semester Number:2
Programming Languages
• Books
• Grades
Final exam 50
Mid-term exam 20
Coursework 30
What is this class about?
• The course is designed to develop overview of
structure elements.
• Basics of algorithms. introduction to Object-
oriented programming elements, and Java
programming elements.
• Understanding of the programming using Java
syntax.
Course overview
• Structured program development:
- Problem solving decision structure
- Repetition structures
• Subprograms:
-Procedures and
-Functions
• Structured data types:
-one/two dimension arrays
– Strings
– Dynamic data structures (pointers)
– Recursion.
Basic concepts
Before we investigate the role of computers in
solving problems, we need to become familiar
with few basic concepts. Let’s explore what is
really meant by:
A problem
An algorithm
A program
After we define the above concepts, we will talk
about how these concepts can work together to
develop computer programs that can solve many
interesting problems.
Module 1: Introduction
Topic 1: The Big Picture
• After completing this topic , you will be able to:
1. Define the meaning of a problem.
2. Define the meaning of an algorithm.
3. Define the meaning of a program.
4. Visualize the relationship among problems,
algorithms, and programs.
Module 1: Introduction
In this course, we are more interested in
computational problems.
Example of Computational Problems
A common example of computational problems is
the sorting problem.
For example: given the input sequence
(31, 41, 59, 26, 41, 58), the solution of the sorting
problem should sort these numbers to produce the
following output
(26, 31, 41, 41, 58, 59).
Module 1: Introduction
Is it only one solution?
14
Let N=0;
For each child in room then
Set N=N+1
15
Module 1: Introduction
Definition of an Algorithm?
Since our focus in this course is on computational
problems, an algorithm can be informally defined
as “any well-defined computational procedure
that takes some value, or set of values, as input
and produces some value, or set of values, as
output ”
Print num
End
Copyright © 2014 Pearson Education, Inc.
Example
• Write an algorithm to print “passed” if student grades
equal or more than 60 and print ”faild” in other cases.
Start
Declare grade
Read grade
If grade>=60
Print passed”
else
Print””Faild”
end
Algorithm
Program 30
(Pseudo-code)
What is a program?
• Before a machine such as a computer can perform a task, an algorithm
for performing that task must be discovered and represented in a form
that is compatible with the machine so the machine can understand it.