23-24-Quarter-1-Computer 8- Chapter1.pptx

michelleplacides21 17 views 28 slides Jun 18, 2024
Slide 1
Slide 1 of 28
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
Slide 28
28

About This Presentation

History of C++
Programming languages


Slide Content

Introduction to Programming Lesson 1

Programming a technological process for telling a computer which tasks to perform in order to solve problems. Programming ethics Thou shalt not use a computer to harm other people. Thou shalt not interfere with other people's computer work. Thou shalt not snoop around in other people's computer files. Thou shalt not use a computer to steal. Thou shalt not use a computer to bear false witness. Thou shalt not copy or use proprietary software for which you have not paid (without permission). Thou shalt not use other people's computer resources without authorization or proper compensation. Thou shalt not appropriate other people's intellectual output. Thou shalt think about the social consequences of the program you are writing or the system you are designing. Thou shalt always use a computer in ways that ensure consideration and respect for other humans

Programming Languages Programming is a skill that is becoming increasingly sought after in the job market. Having at least a basic understanding of how software functions is helpful for anyone who interacts with technology. With a background in programming, you can get a job coding, designing software, data architecture, or creating intuitive user interfaces.  5 major types of programming languages 1. Procedural programming languages A procedural language follows a sequence of statements or commands in order to achieve a desired output. Each series of steps is called a procedure, and a program written in one of these languages will have one or more procedures within it. Common examples of procedural languages include: C and C++ Java Pascal BASIC

Programming Languages 2. Functional programming languages functional languages focus on the output of mathematical functions and evaluations. The result will vary depending on what data you input into the function. Some popular functional programming languages include: Scala Erlang Haskell Elixir F# 3. Object-oriented programming languages (OOP) This type of language treats a program as a group of objects composed of data and program elements, known as attributes and methods. Objects can be reused within a program or in other programs. This makes it a popular language type for complex programs, as code is easier to reuse and scale. Some common object-oriented languages include: Java Python PHP C++ Ruby

Programming Languages 4. Scripting languages Programmers use scripting languages to automate repetitive tasks, manage dynamic web content, or support processes in larger applications. Some common scripting languages include: PHP Ruby Python bash Perl Node.js 5. Logic programming languages Instead of telling a computer what to do, a logic programming language expresses a series of facts and rules to instruct the computer on how to make decisions. Some examples of logic languages include: Prolog Absys Datalog Alma-0

COMPILER A compiler is a special program that translates a programming language's source code into machine code, bytecode or another programming language. The source code is typically written in a high-level, human-readable language such as Java or C++.

NUMBER SYSTEM A value each digit in number can be determine using the Digit The position of the number The base of the number system The are several number systems that computer Decimal Binary Octal Hexadecimal

Binary system Bits is the most basic unit of information in computing and digital communications. Binary is a way of representing data using 0s and 1s Sample: 1 0 10 10 11

Decimal system Uses digits from 0-9 to represent a number with the base 10.

Introduction to C++ Programming Lesson 1

Next History of C++ C++ was originally invented in 1979 by the Danish developer Bjarne Stroustrup

Why learn C++ Programming?

Basic Structures of C++ Programming

Line 1 //my first program using C++ language Line 2 #include< iostream > Line 3 using namespace std ; Line 4 int main () Line 5 { Line 6 cout <<“I love programming!”; Line 7 return 0; Line 8 }

Line 1 This line begins with two slash signs, indicating a comment. Any text that follows these double slash will be ignored by the compiler and will have no effect on the program. Programmers put comments inside their C++ source code to serve as their notes or bookmarks in the document.

Line 2 The hash symbol is a directive for the pre-processor. It is not a regular code line with expressions but an indicator for the compiler’s pre-processor. Iostream means INPUT/OUTPUT STREAMS.

Line 3 The line means that all the elements of the standard C++ library are declared within what is called a namespace.

Line 4 This line declares the beginning of the program or process because of the definition of our function called main. The main function is the point by where all C++ programs begin their execution, dependent of its location within the source code.

Line 5 This line indicates the beginning of the program body. It is indicated by an opening curly brace.

Line 6 This line is a C++ statement. A statement is a piece of instruction that is executed inside the body of any function. Statements make up the body of any function.

Line 7 The line with a return code of 0 for the main function is generally interpreted that the program worked as expected without any error during its execution. The return statement causes the main function to finish.

Line 8 The closing curly brace indicates the end of the program body.

Comments Comments are parts of the source code disregarded by the compiler. In other words, these lines serves as notes to the programmer.

Types of Comments Double slash (//) tells the compiler to ignore everything that follows the double slash until the end of the line. Slash – star (/*) tells the compiler to ignore everything that follows until it finds a star – slash comment mark.

What is an Identifier An identifier is the name of C++ entity such as variables and functions. There are rules in writing identifiers.

An identifier must begin with a letter of the alphabet. The first character of the identifier may be followed by any letter of the alphabet, any digit (0 – 9). The identifier has no limit on the number of characters it may have. C++ is case – sensitive. The identifiers, Total, total, and TOTAL are all different.

If an identifier consists of two or more words, we may do any of the following: Use underscore to separate the words. Example: total_amount amount_paid Capitalize the first character of each word except the first. Example: areaOfTriangle middleName

PROGRAM #include <iostream> using namespace std; Int main () { cout <<“Hello World\n”; return 0; }
Tags