computer engineering 2 nd semester dr. rabie a. ramadan 2
TRANSCRIPT
![Page 1: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/1.jpg)
Computer Engineering 2nd Semester
Dr. Rabie A. Ramadan
http://rabieramadan.org/classes/2011/prog/
2
![Page 2: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/2.jpg)
2
Class Rules
It will be a tough class , however,• Enjoy what you do
Do not worry about the exam as long as :• You are reading and understanding the materials in the book
I do not care how are you going to learn programming language
The section will help you to do so but it is your responsibility to dig in the subject
![Page 3: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/3.jpg)
3
Class Rules Attendance is a must
Assignments must be delivered on time no exception whatever the reason.
The source code must be submitted with any programming assignment
![Page 4: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/4.jpg)
Class Rules
You can bring anything to drink but NO FOOD PLEASE
When you come in , DO NOT knock on the door
When you want to leave , Do NOT tell me Just leave but you will counted as absent
![Page 5: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/5.jpg)
5
Class Information
Text Books• Rabie Ramadan , Computer Engineering for Developers, 2011
• Other sources
• Website
• http://www.rabieramadan.org/classes/2011/prog/
•
![Page 6: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/6.jpg)
Before We Start ….
25th of January
Be Smart
![Page 7: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/7.jpg)
Programming Language Programming Language
programming language is a tool used by a programmer to give the computer very specific instructions in order to serve some purpose for the user.
A program is like a recipe.
• mix eggs, butter, sugar in a bowl
• add flour, baking soda, and flavorings
• mix until creamy
• add chocolate chips
• bake in the oven.
Can you make chocolate cake out of this recipe ?Can you make chocolate cake out of this recipe ?
![Page 8: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/8.jpg)
Do we need more details ?Do we need more details ?
YesYes
• place two eggs in a bowl
• add 1.5 c. butter to the eggs..
• bake cookies for 10-12 minutes at 375 degrees or until brown
• Is there anything missing ?Is there anything missing ?• Well , it does not say how to put the eggs shelled or not. Well , it does not say how to put the eggs shelled or not.
• It adds some illustrations It adds some illustrations
![Page 9: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/9.jpg)
Computer ProgrammingComputer Programming
Computer does not understandComputer does not understand
You need to tell it every detailsYou need to tell it every details
Therefore, we have languages to tell the computer what to Therefore, we have languages to tell the computer what to do. do.
![Page 10: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/10.jpg)
Is it only one language ?Is it only one language ?
No,No,
There are many languages There are many languages
Each one is designed with a purpose in mind Each one is designed with a purpose in mind
![Page 11: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/11.jpg)
What is behind the high level What is behind the high level language? language?
Computer does not understand the high level language Computer does not understand the high level language
The program must be translated to the machine language The program must be translated to the machine language
Compiler / Interpreter Compiler / Interpreter
Source CodeSource Code Compiler / Interpreter Compiler / Interpreter Object CodeObject Code
![Page 12: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/12.jpg)
Compiler/ Interpreter Compiler/ Interpreter
![Page 13: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/13.jpg)
Why C++?Why C++?
C++ allows expression of abstract ideas
C++ is a third generation language that allows a programmer to express their ideas at a high level as compared to assembly languages.
C++ still allows a programmer to keep low-level control
it has some of the "feel" of an assembly language.
![Page 14: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/14.jpg)
Why C++?Why C++?
C++ has national standards (ANSI)
Code written in C++ that conforms to the national standards can be easily integrated with preexisting code.
C++ is reusable and object-oriented
C++ is widely used and taught
![Page 15: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/15.jpg)
Structure of a program
![Page 16: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/16.jpg)
Line separation
![Page 17: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/17.jpg)
Multiple instructions
![Page 18: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/18.jpg)
Type of Structuring
![Page 19: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/19.jpg)
Comments
![Page 20: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/20.jpg)
C++’ Names The name of a variable: Starts with an underscore “_” or a letter, lowercase or uppercase, such as a letter from a to z or from A to Z.
Examples are Name, gender, _Students, pRice
Can include letters, underscore, or digits. Examples keyboard, Master, Junction, Player1, total_grade, _Score_Side1
![Page 21: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/21.jpg)
C++’ Names
Cannot include special characters such as !, %, ], or $
Cannot include an empty space
Cannot be any of the reserved words
Should not be longer than 32 characters (although allowed)
![Page 22: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/22.jpg)
Reserved keywords
![Page 23: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/23.jpg)
Data Types
A Byte
![Page 24: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/24.jpg)
Data Types
Character
![Page 25: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/25.jpg)
Data Types
\
![Page 26: Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2](https://reader035.vdocuments.site/reader035/viewer/2022062519/5697bfaa1a28abf838c9a614/html5/thumbnails/26.jpg)
Reading Assignment
26
Please Read:
•Program Structure, Variables, Data Types, and Constants
•Operators and Operands
•Basic Input/Output