Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 1: Getting Started by George Lamperti & BU Faculty.

Similar presentations


Presentation on theme: "Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 1: Getting Started by George Lamperti & BU Faculty."— Presentation transcript:

1 Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 1: Getting Started by George Lamperti & BU Faculty

2 Today We Are Going To: Briefly discuss the origins of C++ Briefly discuss the origins of C++ Create a usable working environment Create a usable working environment Write a simple program Write a simple program Discuss some of the things that must happen in order for a program to execute Discuss some of the things that must happen in order for a program to execute

3 Topic C++ Background

4 Programming Computer: device used for calculation; represent numbers with electrical signals Computer: device used for calculation; represent numbers with electrical signals First machines: hard-wired for a specific kind of work First machines: hard-wired for a specific kind of work Ability to modify calculations based on software signals opened new horizons Ability to modify calculations based on software signals opened new horizons Have learned to represent ANYTHING mathematically → Universal Machines Have learned to represent ANYTHING mathematically → Universal Machines

5 Languages: Generations machine: binary codes (10010101) machine: binary codes (10010101) assembly: basically mnemonics for binary instructions (ADD X, Y) assembly: basically mnemonics for binary instructions (ADD X, Y) high-level languages: C, C++, Java high-level languages: C, C++, Java fourth-generation: Perl, VisualBasic, C#, Dot-Net Framework fourth-generation: Perl, VisualBasic, C#, Dot-Net Framework

6 Languages: Styles Interpreted: instructions associated with pre-compiled machine code; executed linearly at time of invocation Interpreted: instructions associated with pre-compiled machine code; executed linearly at time of invocation instructions are machine-independent instructions are machine-independent typically easier to read typically easier to read Compiled: instructions are translated into machine code as a unit Compiled: instructions are translated into machine code as a unit compiler optimizes machine code compiler optimizes machine code compiler catches SYNTAX errors compiler catches SYNTAX errors

7 Languages: Styles “Simple” programming: code executed linearly, variables created automatically “Simple” programming: code executed linearly, variables created automatically Basic, FORTRAN, COBOL (old style) Basic, FORTRAN, COBOL (old style) Structured programming: rules imposed on order of statements Structured programming: rules imposed on order of statements Pascal, C, Structure COBOL, PL/1 Pascal, C, Structure COBOL, PL/1 Object-oriented programming: structure includes concept of object definitions Object-oriented programming: structure includes concept of object definitions C++, Java, C#/Dot Net C++, Java, C#/Dot Net

8 What is C++? High-level, object-oriented language High-level, object-oriented language Compiled language Compiled language Represents an extension of C Represents an extension of C positive: still have access to C functions positive: still have access to C functions negative: still carries some of C “baggage” negative: still carries some of C “baggage”

9 Object Orientation Purpose of programming: create models of the real world that solve problems Purpose of programming: create models of the real world that solve problems Object Orientation: A set of rules imposed on a programming language. Object Orientation: A set of rules imposed on a programming language. Rules allow for better models. Rules allow for better models. OUR WORK will focus on the basics of the language, and will only touch on the rules of OO a little bit. OUR WORK will focus on the basics of the language, and will only touch on the rules of OO a little bit.

10 The Object Model (Terms) Class: C++ definition of a kind of object Class: C++ definition of a kind of object Object: a representation of something in the real world Object: a representation of something in the real world Instance: another term for object Instance: another term for object Property: a characteristic of an object Property: a characteristic of an object Method: something an object can do Method: something an object can do Example: What characterizes a tree? Example: What characterizes a tree?

11 The Object Model (Properties) A “property” is an object characteristic A “property” is an object characteristic The Class definition enumerates the properties (the ones to be modeled) The Class definition enumerates the properties (the ones to be modeled) When the Class is instantiated, values are assigned to those properties When the Class is instantiated, values are assigned to those properties Example: leaf color, leaf shape, bark texture, number of leaves, etc. Example: leaf color, leaf shape, bark texture, number of leaves, etc.

12 The Object Model (Methods) Methods are things that an object can do Methods are things that an object can do Again, the Class defines the actions Again, the Class defines the actions Often useful to think of asking an object to do something Often useful to think of asking an object to do something Example: dropLeaf(), changeLeafColor(), getLeafColor(), getBarkTexture() Example: dropLeaf(), changeLeafColor(), getLeafColor(), getBarkTexture()

13 Topic Problem-Solving with Computer Programs

14 The Steps Requirements: State the Problem Requirements: State the Problem Analysis: Define Data Input and Output Analysis: Define Data Input and Output Design: Specify Solution Algorithm Design: Specify Solution Algorithm Implementation: Writing the Code Implementation: Writing the Code Validation: Compiling and Testing Validation: Compiling and Testing Use and Maintainence Use and Maintainence

15 Topic Memory Handling

16 Memory Management A characteristic of C++ is that memory is handled explicitly A characteristic of C++ is that memory is handled explicitly (Go over components of computer) (Go over components of computer) RAM behaves as the “scratch paper” for the CPU as it does its work RAM behaves as the “scratch paper” for the CPU as it does its work

17 Levels of Memory Primary cache (L1; usually ~16K) Primary cache (L1; usually ~16K) Secondary cache (L2; usually ~256K) Secondary cache (L2; usually ~256K) Main memory (RAM; separate location; usually hundreds of MB) Main memory (RAM; separate location; usually hundreds of MB) Virtual memory (used as a backup for RAM; often a few GB) Virtual memory (used as a backup for RAM; often a few GB)

18 Memory Management Imagine memory as a bunch of cells each with one byte (eight bits) Imagine memory as a bunch of cells each with one byte (eight bits) Each memory location also has an address - the address is a number Each memory location also has an address - the address is a number The number of memory locations depends on the computer - the newest computers are talking about 64-bit addressing The number of memory locations depends on the computer - the newest computers are talking about 64-bit addressing

19 Topic Creating the Development Environment

20 Chaos Attempt to use Visual Studio.NET Attempt to use Visual Studio.NET If have trouble, we will fall back on Microsoft Visual C++ If have trouble, we will fall back on Microsoft Visual C++ There are also command-line tools, so we can go there if need be There are also command-line tools, so we can go there if need be


Download ppt "Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 1: Getting Started by George Lamperti & BU Faculty."

Similar presentations


Ads by Google