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

Class 8 C++ppt1

This document provides an introduction to programming languages and C++. It discusses how programming languages allow communication with computers and examples like C, C++, Java. It then focuses on C++, describing it as an object-oriented programming language and popular applications that use it. It also defines key concepts in object-oriented programming like classes and objects. The document concludes with instructions on setting up a C++ development environment, the structure of C++ programs, and how to compile and run a simple C++ program.
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)
50 views

Class 8 C++ppt1

This document provides an introduction to programming languages and C++. It discusses how programming languages allow communication with computers and examples like C, C++, Java. It then focuses on C++, describing it as an object-oriented programming language and popular applications that use it. It also defines key concepts in object-oriented programming like classes and objects. The document concludes with instructions on setting up a C++ development environment, the structure of C++ programs, and how to compile and run a simple C++ program.
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/ 19

P S SENIOR SECONDARY SCHOOL

MYLAPORE, CHENNAI-600004
SUBJECT : COMPUTER SCIENCE

CLASS :VIII

TOPIC :INTRODUCTION TO
LANGUAGE- COMMUNICATION TOOL

 Language is a tool which helps us to express our thoughts.


 When you want to communicate with other person you need a common
language.
Good morning!!
HOW DO YOU COMMUNICATE WITH COMPUTERS

Hello
????
PROGRAMMING LANGUAGE
❖ To communicate with computers we must know a language which it can understand.
❖ They are called are programming languages.
❖ Examples of programming languages are C, C++, JAVA, BASIC, etc.
❖ The set of instructions that tells a computer to perform some operations are called
program.
❖ A person who creates these program are called programmers.
WHAT IS C++?
 It is a popular programming language
 It was developed by Bjarne Stroustrup in AT
& T Bell laboratory.
 It is an Object Oriented Programming (OOP)
language.
 Some of the popular real time applications
which use C++ are Amazon, Windows OS,
Youtube.
WHAT IS OOP?
 The main objective of OOP is to break the problem down into number of
smaller parts that are simpler and easier to understand.
 There are few principles and concepts that form the foundation of OOP. They
are
 Object
 Class
 Data Abstraction
 Polymorphism
COMPILER

 What is a compiler?
 Compiler is a translator which converts the high level language (source code)
into binary language (object code).
 What is binary language?
 Binary consists of only 0s and 1s which a computer can understand.
 What is high level language?
 High level language is any programming language used to write programs.
Example are C, C++, JAVA, etc.
 Video link on Computer Languages:
 https://youtu.be/H9Nyj5PZxX4
INTRODUCTION TO DEV C++
 DEV C++ is a compiler used in many places to write and execute C++
programs.
 It can be downloaded from the following link
 https://sourceforge.net/projects/orwelldevcpp/
 Click on download button.
INTRODUCTION TO EDITOR WINDOW

 After installing DEV C++, open the application it will start with the following screen.
INTRODUCTION TO EDITOR WINDOW

 Now choose File → New→ Source File.


 Blank window will appear where we can type the C++ programs.
 This screen is called editor window.
STRUCTURE OF C++ PROGRAM

 Now let us discuss the structure of a C++ program.


 Comments
Text within /*-------*/ and after // are treated as comments and are ignored by
the compiler. This is used to explain the purpose of the program. Single line
comment begins with // and double line comments begin and end with /*------*/
 #include
These are known as pre-processor directives. It means that we are including a
header file, which will enable us to perform input/output operations.
STRUCTURE OF C++ PROGRAMS

 Main()
It is used to indicate that the execution of the program will begin from this point
followed by the program statements enclosed within braces.
 Program body
It contains the program statements which cause the action to be taken. The curly
braces indicates the scope of the program.
SAMPLE PROGRAM

#include

main()

Comments
Program
body
COUT STATEMENT

 One of the most widely used statement in C++ language is the cout statement.
 This statement is used to display any message on the output screen.
 cout stands for common output.
 For example if I want to print the text COMPUTER SCIENCE, the following
statement has to be included in the program body
 cout<<“ COMPUTER SCIENCE”;
 << - this is called as insertion operator.
 Any text written within double quotes in a cout statement is displayed as such.
 Always c++ statements end with semicolon.
SAVING THE PROGRAM

 A program can be typed in the editor window to produce some result.


 After typing the program, it has to be saved.
 Select File→Save or press Ctrl+ S. In the Save As dialog box give a
name to the file.
 Now the file is saved.
HOW TO MAKE THE C++ PROGRAM TO WORK?
 This is the important step to see the output of the C++
program.
 Here we have two steps to do
 Compiling - This step is to convert the C++ program into machine
language (0s and 1s)
 Execution/Running – In this step the computer obeys the instruction
given in the program.
HOW TO COMPILE AND RUN A PROGRAM?

 After saving the file, select Execute→ Compile & Run from the menu
bar.
 Now the complier checks the program.
 If there is no error in the program output will be displayed as shown
below
EXERCISE

 Write a program to display your name.


 Write a program to display the following text
 Taj Mahal is located in Agra

You might also like