Lesson 1 - Introduction to Computer Prog 1.pptx

OmarFernandez9 3 views 27 slides Oct 23, 2025
Slide 1
Slide 1 of 27
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27

About This Presentation

ntroduction to Computer Prog 1


Slide Content

Computer Programming 1 By. OAF

Introduction Without software, the computer is useless Software are developed with programming languages. Ex. C ++ , is a programming language C++ suited for a wide variety of programming tasks Note : Before proceeding in any programming , it is useful to understand terminology and computer components.

What is a Programming Language? A programming language is a set of rules that provides a way of telling a computer what operations to perform . A programming language is a set of rules for communicating an algorithm . It provides a linguistic framework for describing computations .

What is a Programming Language? English is a natural language . It has words, symbols and grammatical rules. A programming language also has words, symbols and rules of grammar. The grammatical rules are called syntax . Each programming language has a different set of syntax rules.

Why Are There So Many Programming Languages? Programming languages have evolved over time as better ways have been developed to design them. First programming languages were developed in the 1950s Since then thousands of languages have been developed. Different programming languages are designed for different types of programs.

Levels of Programming Languages High-level program class Triangle { ... float surface() return b*h/2; } Low-level program LOAD r1,b LOAD r2,h MUL r1,r2 DIV r1,#2 RET Executable Machine code 0001001001000101001001001110110010101101001...

Language Family Tree

Some Programming Languages Assembly Language FORTRAN – Formula Translating System COBOL – COmmon Business Oriented Language LISP – LISt Processor PROLOG – PROgramming LOGic C C++ C# Pascal Java

Some Programming Languages SNOBOL – StriNg Oriented and SymBOlic Language Smalltalk APL – A Programming Language Ajax Ruby Simula – Simulation Programming Language Visual Basic Visual Basic .Net Perl HTML – Hyper Text Markup Language

Software Software - programs that do specific tasks System programs - take control of the computer, such as an operating system Application programs - perform a specific task Word processors Spreadsheets Games

The Language of a Computer Digital signals : sequences of 0s and 1s Machine language : language of a computer Binary digit (bit ) : Ex. the digit 0 or 1 Binary code : Ex. A sequence of 0s and 1s Byte : A sequence of eight bits 11

The Language of a Computer ( cont ’ d.)

The Language of a Computer (cont'd.) ASCII (American Standard Code for Information Interchange ) 128 characters A is encoded as 1000001 (65th character) 3 is encoded as 0000011 13

EBCDIC (Extended Binary Coded Decimal Interchange Code) Used by IBM 256 characters Unicode 65536 characters Two bytes are needed to store a character 14 The Language of a Computer (cont'd.)

Assembly language instructions are mnemonic Assembler : translates a program written in assembly language into machine language The Evolution of Programming Languages

The Evolution of Programming Languages High-level languages include Basic, FORTRAN, COBOL, Pascal, C, C++, C#, and Java. Compiler : translates a program written in a high-level language machine language The equation wages = rate • hours can be written in C++ as: wages = rate * hours;

Brief history of C++ Language The C++ programming language has a history going back to 1979, when Bjarne Stroustrup was doing work for his Ph.D. thesis. He began work on "C with Classes", which as the name implies was meant to be a superset of the C language. His goal was to add object-oriented programming into the C language, which was and still is a language well-respected for its portability without sacrificing speed or low-level functionality .

Brief history of C++ Language In 1983, the name of the language was changed from C with Classes to C++. The ++ operator in the C language is an operator for incrementing a variable, which gives some insight into how Stroustrup regarded the language. In 1985, C++ was implemented as a commercial product. The language was not officially standardized yet.

Processing a C++ Program #include < iostream > using namespace std ; main() { // prints My first C program cout <<“My first C++ program”; } Sample Run: My first C++ program.

Processing a C++ Program To execute a C++ program: Use an editor to create a source program in C++ ( .cpp ) Preprocessor directives begin with # and are processed by the preprocessor Use the compiler to: Checks that the program obeys the rules (program is syntactically correct). Translate into machine language ( object program or .obj ).

Processing a C++ Program To execute a C++ program (cont'd.): Linker : Combines object program with other programs provided by the SDK (Starters Development Kit) to create executable code Loader : Loads executable program into main memory The last step is to execute the program

Terms to Remember: Source Program : A program written in a high-level language. Object Program : The machine language version of the high-level language program. Linker : A program that combines the object program with other programs in the library and is used in the program to create the executable code. Loader : A program that loads an executable program into main memory.

Processing a C++ Program

Dev C++ (Editor & Compiler)

Visual Studio Code

End
Tags