0% found this document useful (0 votes)
32 views

L1 Introduction

Uploaded by

hoshos510
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

L1 Introduction

Uploaded by

hoshos510
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

EE202: Object-Oriented Computer Programming

Introduction and Class Review

Dr. Mohammad H. Awedh

Department of Electrical and Computer Engineering


King Abdulaziz University

Spring 2022
EE202: Object-Oriented Computer Programming
Introduction and Class Review

Dr. Mohammad H. Awedh

Department of Electrical and Computer Engineering


King Abdulaziz University

Spring 2022
Introduction

Programming is a detailed step-by-step instructions to tell a


computer how to perform a given task.
An example
set x to 4
set y to 3
set z to x + y
write the value of z
To communicate with a computer, you need to speak its
language, machine language.
Machine languages differ depending on the manufacturer and
model of computer.
An example of machine language is
1110100101010111010100000010100100
Introduction

Machine languages are hard to learn and use.


High-level programming languages are designed to allow
programmers to write computer instructions in a format more
easily understandable by humans.
The instructions that are written in High-level language are
then translated into machine language of the target computer.
Translator (e.g., compiler, interpreter) is a computer program
that translates programs written in high-level languages
(source language) into equivalent program (target language).
Programming Languages

Any natural language (e.g, Arabic) has


Vocabularies: Ali, eat, an, Apple
Grammar rules: <subject> <verb> <object>: Ali eats an
Apple
Meaning rules: It makes sense.
Programming languages (like any natural languages) consist
of
keywords (vocabularies)
syntactic (grammar) rules: the form of its statements
semantic (meaning) rules: the meaning of those statements
The study of new programming languages is to understand
its syntax and semantics.
Programming Paradigms

Widely used:
Imperative: do this and next do that
Examples: Fortran, Algol, Pascal, Basic, C
Object-Oriented: Send messages between objects
Examples: Simula, Smalltalk, Java, C++
Not widely used:
Functional: Modeled on mathematical functions
Evaluate an expression and pass on the result
Examples: Haskell, ML, Lisp, Scheme, Scala
Logical: Logical assertions and deductions answer questions
Example: Prolog
Imperative Programming

Oldest and most obvious approach


Focus on functionality of the system (What it has to do)
Program is a series of instructions
Functions allow some modularization, encapsulation and code
reuse
data and functions are two different things
Programs

A program is a sequence of one or more statements.


Each statement must satisfy the syntax and semantic rules of
the language that is used to write the program.
A statement in a program is a basic sentence (instruction)
that expresses a simple idea.
Examples of statements in a program are assignment
statements, conditional statements and loop statements.
What makes a good programmer?

Being patient
Being organized
Being interested & enjoying it
Never stop learning
Tradeoffs

Designing software is about making tradeoffs between


conflicting objectives.
Simple
Easy to implement
Easy to extend and maintain
Run quickly
Use little memory
Easy for other programmers to understand
Easy to use
Work correctly
Portable to other platforms
Have all the features the client wants (specification)
Compatible with other systems
The C Language

C is a procedural programming language


C is a powerful general-purpose programming language
The main features of C language include low-level access to
memory, simple set of keywords, and clean style
Currently, one of the most commonly-used language (e.g.,
embedded systems, operating systems, databases, compilers)
Very portable: compilers exist for virtually every processor
Easy-to-understand compilation
Produces efficient code
Fairly concise
An excellent language to learn to program for beginners
C History

Developed between 1969 and 1973 along with Unix


Due mostly to Dennis Ritchie
Designed for systems programming
Operating systems
Utility programs
Compilers
Filters
Evolved from B, which evolved from BCPL
C – Built for Performance

Operating Systems
Unix, Linux, Android, portions of Windows, OSX built on
Objective C
Embedded Systems
GPS, Intelligent Traffic Alert, Robots
Realtime Systems
Air traffic control, Industrial automation
Communication Systems
C-based programming languages
Objective C, Java, Visual C#
Python Programming Language

Python is an interpreted high-level general-purpose and a very


popular programming language.
It was created by Guido van Rossum in 1991 and further
developed by the Python Software Foundation.
Python allows programming in Object-Oriented and
Procedural paradigms.
Python programming language is being used in web
development, Machine Learning applications, along with all
cutting edge technology in Software Industry.
Python Programming Language is very well suited for
Beginners, also for experienced programmers with other
programming languages like C++ and Java.
The Software Development Process (Cycle)

Specification: what the program is supposed to do


Design: how the program does its
Choose algorithms
Choose data representation
Implementation: convert your design into code
Convert your algorithm to programming code (in any
programming language)
Compile the program - If there are errors, fix them and compile
again
Testing
Execute your program with test data
If the results are incorrect, go back to the coding step
Test as many different possible types of input as you can think
of.
The Software Development Process (Cycle)

Documentation
What a user needs to know to use the program
What a developer (you or someone else) needs to know to
update the program
Maintenance
Fix any bugs that you didn’t discover in the initial testing
Make improvements you didn’t have time for the first time
Course Information

Instructor Mohammad H. Awedh


Office Location Building ENG40, Room 34C63
Office Hours Tuesday and Thursday 10:00 to 11:00
or by Appointment
E-mail [email protected]

Meeting Lectures: Sunday, Tuesday 11:00 – 12:15


Building ENG40, Room 213
Tutorial Thursday 11:00 – 12:50
Building ENG40, Room 213
Website http://ece.will2learn.net
Prerequisite

Basic programming concepts (EE 201)


Variables and constants
Comments
Mathematical and Logical Expressions
Operators and their precedence
Assignment statements
Scalers and Arrays
Flow control using iterative (loop) and conditional statements
Function definition, call and arguments
Inputs and Outputs
Topics to Cover

Introduction to computers and programming languages


Memory Concepts: variables, pointers and stack
Introduction to Object-Oriented Programming
Introduction to objects and classes in Python
Review of program control statements: selection and
repetition statements
Writing more complex classes
Primitive and reference data types; characters, strings and
arrays
Topics to Cover

Inheritance and polymorphism in Python and Python class


hierarchy
Exceptions and file input and output
Introduction to graphical user interface (GUI) and
Event-Driven Programming
Recursive programming
Documenting sources of code
Sorting and Searching
Course Learning Outcomes

Learn the fundamental concepts associated with imperative


and object-oriented programming
Apply and extend his knowledge of programming concepts
within an object-oriented programming paradigm
Describe the syntax and semantic of the C and Python
programming language
Learn the fundamental concepts of algorithmic design
Understand the importance of program documentation
Course Learning Outcomes

Choose appropriate control structures to account for different


cases of input and different levels of accuracy
Choose the best data type for a solution among simple and
derived data types such as arrays, character and strings,
objects and classes
Modularize the programs using libraries, packages and classes
Learn tools that help to develop applications
Understand Engineering Ethics
Assignments

A reading assignment is assigned prior to each lecture


Students are expected to have read the sections assigned for
the class before the class
In class I will talk about elements from the reading
assignment and solve some related problems
We will be exploring the material together, your participation
and engagement are critical
Homework will be assigned on every week
You will turn in your work at the beginning of the class on the
due date
Exams and Quizzes

There will be a midterm exam and the final.


Quizzes (in class quizzes, pop quizzes or online quizzes) will
be given during the semester.
Recommended Textbook

Programming for Engineers: A Foundational Approach to


Learning C and Matlab, by Aaron R. Bradley
C Programming Language, 2nd Edition, by Brian W.
Kernighan and Dennis M. Ritchie
Grading

Assignments 15%
Participation 10%
Quizzes (in class quizzes, pop quizzes or online quizzes) 15%
Midterm Exams 20%
Final Exam 40%
Policies

All assignments will be due at the beginning of the class on


the due date.
No late submissions will be accepted unless a valid excuse is
given to the instructor by the day prior to the due date.
You are expected to attend all classes.
If you miss a class, you are responsible for finding out the
material covered in that class.
If you miss an exam, a grade of zero will be assigned, unless a
valid excuse is given.
Policies

All assignments are expected to be done by each student


individually.
Verbal and informal exchange of ideas is permitted, indeed
encouraged.
However, written solution should NOT be shown to another
student or copied from another student.
Any act of academic dishonesty will result in an F

You might also like