0% found this document useful (0 votes)
37 views32 pages

CEII Lecture 1

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)
37 views32 pages

CEII Lecture 1

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/ 32

EEC 113

Computer Engineering II

Lecture 1
Class Information

Class meets:
Sunday
Monday
Thursday

Instructor:
Dr. Mohamed A. Torad
[email protected]

Computer Engineering II Dr. Mohamed A. Torad 2


Refrence

C++ PROGRAMMING:
FROM PROBLEM ANALYSIS TO PROGRAM
DESIGN

5th Edition

Computer Engineering II Dr. Mohamed A. Torad 3


Course Aims

Introduction to problem analysis, Algorithm generation and


programming concepts using a C-like programming language,
Management of program space and time requirements. Variables,
Declarations and assignments of numeric data types, Internal
representation of numeric data, Analysis of errors in numerical
computations, Input and output, Selection control structures, loops
and iteration structures, Procedures and functions, Recursion,
Modular program design, Array processing, Characters, Strings and
other data types, Developing computer programs to implement
numerical algorithms of commonly engineering problems.

Computer Engineering II Dr. Mohamed A. Torad 4


Course Content
Week Topic No. of hours Lecture Tutorial Practical

1 4 2 2 -
2 4 2 2 -
3 4 2 2 -
4 4 2 2 -
5 4 2 2 -
6 4 2 2 -
7 Semester First Exam - - - -
8 4 2 2 -
9 4 2 2 -
10 4 2 2 -
11 4 2 2 -
12 4 2 2 -
13 4 2 2 -
14 Final Semester exam - - - -
Computer Engineering II Dr. Mohamed A. Torad 5
Polices- Academic Honesty

• All work must be yours

• Do not share code with classmates

• Do not plagiarize code from the Internet

Computer Engineering II Dr. Mohamed A. Torad 6


Computer Engineering II Dr. Mohamed A. Torad 7
Array

Major hardware components include

• the central processing unit (CPU).


• main memory (MM), also called random access memory (RAM).
• input/output devices.
• secondary storage.

Some examples of input devices are the keyboard, mouse, and secondary
storage.

Examples of output devices are the screen, printer, and secondary storage.
Let’s look at each of these components in greater detail.

Computer Engineering II Dr. Mohamed A. Torad 8


Array

Computer Engineering II Dr. Mohamed A. Torad 9


Array

Computer Engineering II Dr. Mohamed A. Torad 10


Array

Computer Engineering II Dr. Mohamed A. Torad 11


Array

Computer Engineering II Dr. Mohamed A. Torad 12


Array

e. Largest element in the array:

Computer Engineering II Dr. Mohamed A. Torad 13


Array

Computer Engineering II Dr. Mohamed A. Torad 14


Computer Engineering II Dr. Mohamed A. Torad 15
Array

Computer Engineering II Dr. Mohamed A. Torad 16


Array Index Out of Bounds

Computer Engineering II Dr. Mohamed A. Torad 17


Partial Initialization of Arrays During Declaration

Computer Engineering II Dr. Mohamed A. Torad 18


Some Restrictions on Array Processing

Computer Engineering II Dr. Mohamed A. Torad 19


Some Restrictions on Array Processing

Computer Engineering II Dr. Mohamed A. Torad 20


Arrays as Parameters to Functions
By reference only: In C++, arrays are passed by reference only.

Computer Engineering II Dr. Mohamed A. Torad 21


Constant Arrays as Formal Parameters

Computer Engineering II Dr. Mohamed A. Torad 22


Constant Arrays as Formal Parameters

Computer Engineering II Dr. Mohamed A. Torad 23


Constant Arrays as Formal Parameters

Computer Engineering II Dr. Mohamed A. Torad 24


Constant Arrays as Formal Parameters

Computer Engineering II Dr. Mohamed A. Torad 25


Base Address of an Array and Array in Computer Memory

the memory allocated for an int variable is


four bytes.

Computer Engineering II Dr. Mohamed A. Torad 26


Integral Data Type and Array Indices

Computer Engineering II Dr. Mohamed A. Torad 27


Other Ways to Declare Arrays

Computer Engineering II Dr. Mohamed A. Torad 28


Searching an Array for a Specific Item

Computer Engineering II Dr. Mohamed A. Torad 29


Searching an Array for a Specific Item

Computer Engineering II Dr. Mohamed A. Torad 30


Searching an Array for a Specific Item

Computer Engineering II Dr. Mohamed A. Torad 31


Searching an Array for a Specific Item

Computer Engineering II Dr. Mohamed A. Torad 32

You might also like