COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.

Slides:



Advertisements
Similar presentations
Introduction to Programming in C++ John Galletly.
Advertisements

COSC 120 Computer Programming
Programming Basics Aims of Programming: –The aim of programming is to write programs to accomplish complex tasks Programming method: –functional decompositional.
Problem Solving and Program Design Programming. COMP104 Lecture 3 / Slide 2 Problem Solving Process l Define and analyze the problem. l Develop a solution.
1 Session-I & II CSIT-121 Spring 2006 Session Targets Introducing the VC++.NET Solving problems on computer Programming in C++ Writing and Running Programs.
Simplest program and Data Output Sen Zhang. The simplest program looks like a single person company! void main() { // this starts a comment line // here.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Chapter 3: Introducing the Microsoft.NET Framework and Visual Basic.NET Visual Basic.NET Programming: From Problem Analysis to Program Design.
Lecture 5: Computer Languages. Programming Environments (IDE) COS120 Software Development Using C++ AUBG, COS dept.
Basic Elements of C++ Chapter 2.
Creating a Console Application with Visual Studio
COS120 Software Development Using C++ AUBG Fall semester 2010
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.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Chapter Introduction to Computers and Programming 1.
Visual Basic Chapter 1 Mr. Wangler.
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
Chapter 2 Overview of C Instructor: Kun-Mao Chao ( 台大資工 趙坤茂 )
Microsoft Visual Basic 2005: Reloaded Second Edition
© 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 2 : Overview of C By Suraya Alias. /*The classic HelloWorld */ #include int main(void) { printf(“Hello World!!"); return 0; }
COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
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.
Computer Science 101 Introduction to Programming.
Lecture 6: Computer Languages. Programming Environments (IDE) COS120 Software Development Using C++ AUBG, COS dept.
Computer Science I How to Configure Visual Studio.NET 2003 for C++ Colin Goble.
1 C++ Programming Basics Chapter 2 Lecture CSIS 10A.
Week 1 Algorithmization and Programming Languages.
C++ Programming: Basic Elements of C++.
1 INF160 IS Development Environments AUBG, COS dept, Fall semester 2011 Reference books: Baltzan Paige, Business Driven Information Systems, McGraw- Hill/Irwin,
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Chapter 2 Overview of C++. 2 Overview  2.1 Language Elements  2.2 Reserved Words & Identifiers  2.3 Data Types & Declarations  2.4 Input/Output 
Introduction to C++ Basic Elements of C++. C++ Programming: From Problem Analysis to Program Design, Fourth Edition2 The Basics of a C++ Program Function:
Chapter 0 Getting Started. Objectives Understand the basic structure of a C++ program including: – Comments – Preprocessor instructions – Main function.
I/O and Data Formatting Introduction to Class Concepts INFSY 307 Spring 2003 Lecture 3.
Chapter 2 part #1 C++ Program Structure
COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.
COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot.
1 8/31/05CS150 Introduction to Computer Science 1 Hello World!
Operating System Using setw and setprecision functions Using setiosflags function Using cin function Programming 1 DCT
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
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.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 3: Input/Output Samples.
Problem Solving and Program Design. Problem Solving Process Define and analyze the problem. Develop a solution. Write down the solution steps in detail.
Bill Tucker Austin Community College COSC 1315
Chapter 2: Basic Elements of C++
Chapter Topics The Basics of a C++ Program Data Types
Chapter 1: Introduction to computers and C++ Programming
Chapter 2 Introduction to C++ Programming
Completing the Problem-Solving Process
Basic Elements of C++.
The Selection Structure
Chapter 2: Basic Elements of C++
Basic Elements of C++ Chapter 2.
Lab 1 Introduction to C++.
Chapter 1: An Overview of Computers and Programming Languages
1. Open Visual Studio 2008.
ms vısual studıo 2008-Introductıon TUTORIAL
Lab 1 Introduction to C++.
CS150 Introduction to Computer Science 1
Double click Microsoft Visual Studio 2010 on the Computer Desktop
Presentation transcript:

COS120 Software Development Using C++ AUBG Fall semester 2010 Ref book: Problem Solving, Abstraction and Design Using C++ Authors: Frank Friedman, Elliot Koffman, Course lecturer: Assoc. Prof. Stoyan Bonev, PhD

Lecture 6: Computer Languages. Programming Environments (IDE)

3 Lecture Contents: t Programming environments. Integrated Development Environments (IDE) t Borland C++ IDE t The C++ PL elements t The elements of Programming Style t Sample programs in C++

4 IDE MS Visual Studio 2010

5 Introduction to MS Visual C t When you activate IDE for the first time, it’s time for you to make your choice:

6 Intro to MS Visual C Creating Unmanaged Application To build a console application that will run without.NET framework, follow these steps: 1. Open Visual Studio.NET On the Start Page, click New Project…. If the Start Page isn’t visible, Choose File, New, Project. 3. Select the Visual C++\Win32 from Installed Project Templates on the left and select Win32 Console Application Project type on the right. 4. Enter project name, for example ConsoleApplication1, project location, for example Q: drive and click OK. 5. Click Finish from the wizard that appears. The wizard generates the skeleton of an unmanaged C++ application. To build the project, follow these steps: 1. Choose Build, Build Solution or press F7 To run the project, follow these steps: 1. Choose Debug, Start Without Debugging or press Ctrl+F5

7

8

9

10

11

12

13

14

15 Intro to MS Visual C Creating Managed Application To build a console application that will run within.NET framework, follow these steps: 1. Open Visual Studio.NET On the Start Page, click New Project…. If the Start Page isn’t visible, Choose File, New, Project. 3. Select the Visual C++\CLR from Installed Project Templates on the left and select CLR Console Application Project type on the right. 4. Enter project name, for example ConsoleApplication1, project location, for example Q: drive and click OK. 5. The wizard generates the skeleton of a managed C++ application. To build the project, follow these steps: 1. Choose Build, Build Solution or press F7 To run the project, follow these steps: 1. Choose Debug, Start Without Debugging or press Ctrl+F5

16

17

18 IDE Borland C++

19 Intro to Borland C++ How to compile and execute C++ applications? Click Start from Task bar, Select Run… and click on it Enter cmd command and click OK or press Enter to open an MSDOS window Change current device to Q: drive and call command H:\borlandc\bin\bc.exe Press F10 >> Options >> Directories. Check Drive letter for Include and Library directories to be H, Drive letter for output and source directory to be Q Press F10 >> File >> New, enter the source text of your program Press F10 >> Save As… to name and save your program as a source file (.cpp). Press F10 >> Compile >> Compile (or Alt+F9) and look at the compiler messages. In case of errors and/or warnings, you should edit and recompile your source text until “0 warnings, 0 errors, Success” is displayed Press F10 >> Run >> Run (or Ctrl+F9) to run your program.

20

21 C++ programs topics t Compiler (preprocessor) directives; t Names: reserved words (keywords), standard defined and user defined identifiers; t Variable declarations and data types; t Executable statements; t General structure of a C++ program; compiler (preprocessor) directives using namespace std; int main() { definition (declaration) statements executable statements }

22 Elements of programming style t Spaces in a program; t Using comments; t Mnemonic identifiers; t Arithmetic expressions. Rules for expressions evaluation: –Parentheses rule – (sub expressions) first; –Precedence rule – highest priority first; –Association rule – left or right associative operators.

23 input/output manipulators t I/O manipulators are used to control and modify data that is extracted from input stream or inserted to output stream. t I/O manipulators are active after including the following header files: #include or#include #include #include using namespace std;

24 Input/output manipulators t endlInserts the newline character into an output stream. t setw(n)Controls the width of an output field. t dec, hex, octControls the numeric system base (10, 16, 8) used to display values. t fixed, scientificCauses real numbers to display in decimal or in scientific notation. t showpointEnsures decimal point and trailing zeros if necessary always to appear. t setprecision(n)Sets the precision to n decimal places. t left, rightLeft-adjust or right-adjust output in field.

25 Previous lecture reminder Title: A Tutorial Introduction to C/C++ Source: Friedman/Koffman, Chapter 02 Have a quick look at next slide to refresh your knowledge on previous lecture

Overview of C++ Open to read slides 5-64 from Lecture 5 COS120lec5_VisualC.ppt

27 Exercise 6.1 Build and run all programs from lecture 5: To compute and display the volume of a pool; To add, subtract, multiply and divide two numeric values; To convert Celsius degrees to Fahrenheit degrees Fahr = 9./5.*Cel+32 To convert Fahrenheit degrees to Celsius degrees Cel = 5./9.*(Fahr-32) To convert meters to feet and inches;

28 Exercise 6.2 Build and run a program: To convert miles to kilometers

29 Exercise 6.3 Build and run a program: To find the value of coins (quarters, dimes, nickels, pennies) in dollars/cents.

30 Homework 1 t Paper record to be presented before the end of next class t Tasks: –See.doc file.

31 Reminder Quiz #1 On Algorithms and Elementary C++ will take place next lesson

32 Before lecture end Lecture: Computer Languages. Programming environments (IDE) More to read: Friedman/Koffman, Chapter 02

33 Thank You For Your Attention