Computer science By/ Midhat Mohiey. Introduction to Programming using C ++ 2.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

Introduction to Programming in C++ John Galletly.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
COSC 120 Computer Programming
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
Three types of computer languages
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Chapter 1 Introduction to Programming. Computer Hardware CPU Memory –Main or primary –Secondary or auxiliary Input device(s) Output device(s)
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CS102 Introduction to Computer Programming
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
Chapter Introduction to Computers and Programming 1.
COMPUTER SCIENCE I C++ INTRODUCTION
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Introduction to Computer Programming itc-314
Programming Languages
High-Level Programming Languages: C++
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 13: An Introduction to C++
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
Programming Fundamentals. Today’s Lecture Why do we need Object Oriented Language C++ and C Basics of a typical C++ Environment Basic Program Construction.
Course Title: Introduction to C++ Course Instructor: ADEEL ANJUM Chapter No: 01 1 BY ADEEL ANJUM (MCS, CCNA,WEB DEVELOPER)
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
1 12/4/1435 h Lecture 2 Programs and Programming Languages.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Copyright © 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Software Engineering Algorithms, Compilers, & Lifecycle.
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming
Foundations of Computer Science C & C++ programming lecture 2
Lecture 1b- Introduction
Chapter Topics The Basics of a C++ Program Data Types
Chapter 1: Introduction to computers and C++ Programming
Programming Languages
LESSON 1 Introduction to Programming Language
Basic Elements of C++.
C Language VIVA Questions with Answers
Introduction to C++ Introduced by Bjarne Stroustrup of AT&T’s Bell Laboratories in mid-1980’s Based on C C++ extended C to support object-oriented programming.
Chapter 1. Introduction to Computers and Programming
Introduction to C Programming Language
Basic Elements of C++ Chapter 2.
TRANSLATORS AND IDEs Key Revision Points.
Chapter 1: Introduction to Computers and Programming
Programming 1 (CS112) Dr. Mohamed Mostafa Zayed 1.
Introduction to C++ Introduced by Bjarne Stroustrup of AT&T’s Bell Laboratories in mid-1980’s Based on C C++ extended C to support object-oriented programming.
Introduction to Computer Programming
CS IA: Procedural Programming CS IB: Object-Oriented Programming
Chapter 1: Introduction to Computers and Programming
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Computer science By/ Midhat Mohiey

Introduction to Programming using C ++ 2

3 Programming is the process of writing instructions in any computer programming language, to get the task done by a computer. C++ is a very common programming language, and a good language to start learning basic concepts with, but you need to figure out what you find most useful. To do that you will have to try different programming languages over the time see which ones fits best to you, which language structure makes sense, which one seem to be able to accomplish the goals you want etc. Writing the program is the process of breaking out your instructions step by step and instructing the compiler or interpreter to those things in the proper programming languages.  Your first step is to figure out exactly what you want your program to do, step by step. It is helpful to write this out on paper(Algorithm). Once you gain more experience you will start to see the value in doing this.  Once you have your steps figured out,you will want to write a program in the language you have choosen. Whatever [programming language you choose, it will have specific word and styles to do different things. Much like we use words and punctuation every day, so do programs.

4 The origin of C++ C++ is an object oriented language and was developed by Bjarne Stroustrup starting in 1979 at AT and T Bell laboratories as an enhancement to the C programming languages and originally named C with classes. It was renamed C++ in 1983 where ++ is an incrementer operator in C and C++.The Programming language was developed at AT and T for the purpose of writing the UNIX operating system. C was developed with the primary goal of Operating efficiency. Bjarne Stroustrup developed C++ in order to add objects oriented constructs to the C language. C++ is also considered t\as the combination of C along with Object Oriented features of Simula7. C++ is also a traditional procedural language with some additional constructs. A well written C++ program with some additional constructs. A well written C++ program will reflect elements of both object oriented programming style and classic procedural programming. C++ is actually an extensible language since we can define new styles in such a way that they act just like the predefined types which are the part of standard language C++ is designed for large scale software development. C++ is regarded as a “ Middle-level” language, as it comprises combination of both high-level and low-level language features.

5 Programming language can be classified into following types: –Machine Language Machine language are the only language understood by computers. While easily understood by computers, machine languages are almost impossible for humans to use because they consist entirely of numbers..

Assembly language Assembly languages have the same structures and set of commands as machine languages but they enable a programmer to use names instead of numbers.

High Level languages A programming languages such as C, FORTRAN or PASCAL that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages. Machine languages and Assembly languages both are low-level languages since they are closer to the hardware

Some Well-Known Programming Languages BASIC FORTRAN COBOL C C++ C# Java JavaScript Python Ruby Visual Basic

Integrated Development Environments (IDEs)

What is a Program Made of? Common elements in programming languages: 1)Key Words 2)Programmer-Defined Identifiers 3)Operators 4)Punctuation 5)Syntax

Program 1-1

1.Key Words Also known as reserved words Have a special meaning in C++ Can not be used for any other purpose Key words in the Program 1-1: using, namespace, int, double, and return

Key Words

2)Programmer-Defined Identifiers Names made up by the programmer Not part of the C++ language Used to represent various things: variables (memory locations), functions, etc. In Program 1-1: hours, rate, and pay.

3)Operators Used to perform operations on data Many types of operators: –Arithmetic - ex: +,-,*,/ –Assignment – ex: = Some operators in Program1-1: > = *

Operators

4)Punctuation Characters that mark the end of a statement, or that separate items in a list In Program 1-1:, and ;

Punctuation

5)Syntax The rules of grammar that must be followed when writing a program Controls the use of key words, operators, programmer-defined symbols, and punctuation

20 Structure of simple c++ programs #include using namespace std; int main() { cout << "welcome ITC students in c++ world " << endl; return 0; }

23 #include Lines beginning with a hash sign (#) are directives for the prepocessor. In this case the directives #include tells the processor to include the header file iostream which is a standard file. This specificfile (iostream) includes the declarations of the basic standard input-output library in C++, and is included because functions (cout) from this file is used in the program

A BEGINNER’S C++ PROGRAM Screen output Enjoy yourself with C++!