Programming Basics Aims of Programming: –The aim of programming is to write programs to accomplish complex tasks Programming method: –functional decompositional.

Slides:



Advertisements
Similar presentations
An Introduction to Programming with C++ Fifth Edition Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Advertisements

© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Introducing Algorithms, Pseudocode and.
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.
1 Lecture 5: Input/Output (I) Introduction to Computer Science Spring 2006.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
How to Program in C++ CHAPTER 3: INPUT & OUTPUT INSTRUCTOR: MOHAMMAD MOJADDAM.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, C++ Version, Fourth Edition.
Chapter 4 Sec. 4.1, 4.2, 4.4 Procedures (User-defined)
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.
C++ fundamentals.
CHAPTER 1: INTORDUCTION TO C LANGUAGE
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Chapter Introduction to Computers and Programming 1.
A First Program Using C#
COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - HelloWorld Application: Introduction to.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Lecture 6: Computer Languages. Programming Environments (IDE) COS120 Software Development Using C++ AUBG, COS dept.
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
Lecture #5 Introduction to C++
3. The Nuts and Bolts of C++ Computer Programming 3. The Nuts and Bolts of C++ 1 Learning the C++ language 3. The Nuts and Bolts of C++
Lecture 3: The parts of a C++ program Professor: Dr. Miguel Alonso Jr. Fall 2008 CGS2423/COP1220.
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)
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
Using Microsoft Visual Studio C++ Express 2005 Name: Dr Ju Wang Ashwin Belle Course Resource:
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Control Structures (B) Topics to cover here: Sequencing in C++ language.
1 A simple C++ program // ======================================================= // File:helloworld.cpp // Author:Vana Doufexi // Date:1/4/2006 // Description:Displays.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
Chapter 3: User-Defined Functions I
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 6: User-Defined Functions I.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Open project in Microsoft Visual Studio → build program in “Release” mode.
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 1: Introduction to Computers and Programming.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
STRUCTURED PROGRAMMING Complete C++ Program. Content 2  Main Function  Preprocessor directives  User comments  Escape characters  cout statement.
Bill Tucker Austin Community College COSC 1315
Great way to learn is by example so fire up Visual Studios C (at home make sure you custom install with C++ - no longer default) by Deborah R. Fowler.
Chapter 6: User-Defined Functions I
Computer Terms Review from what language did C++ originate?
ANNOUNCEMENT The missed lecture will be made up this Monday evening in the Tech PC classroom (MG51). A tentative time interval is 6:30-8:00. The exact.
Visual Info Processing Programming Guide (More Details)
Completing the Problem-Solving Process
Value-Returning Functions
Chapter 2 part #1 C++ Program Structure
Beginning C++ Programming
Choice of Programming Language
Chapter 8: Introduction to High-Level Language Programming
Chapter 1: An Overview of Computers and Programming Languages
1. Open Visual Studio 2008.
Chapter 3: Input/Output
Lab 1 Introduction to C++.
CS IA: Procedural Programming CS IB: Object-Oriented Programming
Programs written in C and C++ can run on many different computers
Computer Terms Review from what language did C++ originate?
Chapter 2 part #1 C++ Program Structure
Presentation transcript:

Programming Basics Aims of Programming: –The aim of programming is to write programs to accomplish complex tasks Programming method: –functional decompositional programming method –Tasks can be broken down into smaller tasks, and further the smaller tasks can be broken down into the smallest tasks, which is called the decompositional programming method. A smallest task can be represented and accomplished with a function in the program, which is called the functional decompositional programming method –A function is a set of expressions or statements in C or C++.

FD method example

FP and OOP FP means Functional Programming and OOP means Object Oriented Programming. FP is a way to write programs with functions to be manipulated top-down stepwise; while OOP to classify the objects to set up classes with variables and then represent the objects with real figures under the classes. Programming in C or C++ –C was developed in 1984 and C++ in C is used for FP. C++ can be used for both FP and OOP.

Software and Programs Software – a collection of programs. Program = data + algorithms + programming syntax. System programs. Application programs. The following few slides will tell you how to create a programming environment using Microsoft Visual Studio 2008

When open the Visual studio C , click on the new project will bring up the dialogue above. Click on the General and select Empty Project in the left Window. Give a name for your project.

Follow the instruction shows above to add a new item to your project. You need to right click on the source files to get this.

Your added files should have a cpp extension. The name you assign to this file should be same as your project file.

Hello.cpp – first c++ program #include int main() { std::cout << "Hello,World!\n"; } The first line of this source code is a preprocessor directive that tells the C++ compiler where to find the definition of the std::cout object that is used on the third line. The identifier iostream is the name of a file in the Standard C++ Library. Every C++ program that has standard input and output must include this preprocessor directive. Note the required punctuation: the pound sign # is required to indicate that the word “include” is a preprocessor directive; the angle brackets are required to indicate that the word “iostream” (which stands for “input/output stream”) is the name of a Standard C++ Library file. The expression is called a standard header. The second line is also required in every C++ program. It tells where the program begins. The identifier main is the name of a function, called the main function of the program.

Run your first program On the Build menu, click Build Solution. The Output window displays information about the compilation progress, such as the location of the build log and a message that indicates the build status. On the Debug menu, click Start without Debugging. If you used the sample program, a command window is displayed that shows whether certain integers are found in the set.