Hello World 2 What does all that mean?.

Slides:



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

Chapter 1: An Overview of Computers and Programming Languages
CSE202: Lecture 1The Ohio State University1 Introduction to C++
INTRODUCTION T.Najah Al_Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System CS240.
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 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?
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
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.
CHAPTER 1: AN OVERVIEW OF PROGRAMMING INSTRUCTOR: MOHAMMAD MOJADDAM How to Program in C++
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages Updated by: Dr\Ali-Alnajjar.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Introduction to C++ - How C++ Evolved Most popular languages currently: COBOL, Fortran, C, C++, Java (script) C was developed in 1970s at AT&T (Richie)
Intro. to Game Programming Want to program a game?
Hello World 2 What does all that mean?.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
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.
Creating your first C++ program
Programming With C.
Chapter 1: An Overview of Computers and Programming Languages
Programming Fundamentals. Today’s Lecture Why do we need Object Oriented Language C++ and C Basics of a typical C++ Environment Basic Program Construction.
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.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
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?
Basic Program Construction
1 A simple C++ program // ======================================================= // File:helloworld.cpp // Author:Vana Doufexi // Date:1/4/2006 // Description:Displays.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 05, 2005 Lecture Number: 4.
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 8/31/05CS150 Introduction to Computer Science 1 Hello World!
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Introduction to C++.  Computers: CPU, Memory & Input / Output (IO)  Program: Sequence of instructions for the computer.  Operating system: Program.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
1 Structure of Simple C++ Program Chapter 1 09/09/13.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Chapter 1: Introduction to Computers and Programming.
Software Engineering Algorithms, Compilers, & Lifecycle.
Foundations of Computer Science C & C++ programming lecture 2
C++ First Steps.
Programming what is C++
C++ Programming: Presentation 1
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Computer Terms Review from what language did C++ originate?
Chapter 1: Introduction to computers and C++ Programming
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.
CSCI-235 Micro-Computer Applications
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
2.1 Parts of a C++ Program.
Chapter 1: An Overview of Computers and Programming Languages
Hardware & Software Programming. COMP102 Prog. Fundamentals I: Software / Slide 2 l Four components of a computer system: n CPU - central processing unit.
The Programming Process
Chapter 1: An Overview of Computers and Programming Languages
CS IA: Procedural Programming CS IB: Object-Oriented Programming
Chapter 2: Introduction to C++.
Programs written in C and C++ can run on many different computers
Capitolo 1 – Introduction C++ Programming
Reminders Please turn off cell phones.
Computer Terms Review from what language did C++ originate?
COMS 261 Computer Science I
Chapter 1 c++ structure C++ Input / Output
Chapter 2 part #1 C++ Program Structure
Presentation transcript:

Hello World 2 What does all that mean?

The Evolution of Programming Languages Early computers programmed in machine language To calculate wages = rate * hours in machine language: 100100 010001 //Load 100110 010010 //Multiply 100010 010011 //Store

The Evolution of Programming Languages (cont’d.) Assembly language instructions are mnemonic Assembler: translates a program written in assembly language into machine language

The Evolution of Programming Languages (cont’d.) High-level languages Express algorithms at a more abstract level: int wages = rate * hours; Ex: Basic, FORTRAN, COBOL, Pascal, C, C++, C#, and Java http://oreilly.com/news/graphics/prog_lang_poster.pdf http://www.digibarn.com/collections/posters/tongues/tongues.jpg Current popularities http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

The Evolution of Programming Languages (cont’d.) Compiler: translates a program written in a high-level language into machine language

Processing a C++ Program (cont’d.) To execute a C++ program: Create a text source program in C++ Preprocessor directives begin with # and are processed by the preprocessor Compiler: Checks that the program obeys the language rules Translates into machine language (object program)

Processing a C++ Program (cont’d.) To execute a C++ program (cont'd.): Linker: Combines object program with other programs provided by the SDK to create executable code Library: contains prewritten code you can use

How the code works: # : preprocessor directive Instructions to do before compiling Bring the code from the library iostream into this file

How the code works: Use all the names that are in the "standard" grouping in my program Alternative:

How the code works: ; statement terminator Ends a "sentence of code"

How the code works: int main() The starting point of our program Program instructions go inside { }

How the code works: Comment : computer ignores // : rest of line is comment /* : everything is comment until */ /** : special comment – machine readable

Documentation Every file should have comment like this at top:

How the code works: cout : console output

How the code works: cout : console output << "send to output"

How the code works: cout : console output << "send to output" "Hello" : a string – piece of text

How the code works: cout : console output << "send to output" "Hello" : a string – piece of text endl : symbol representing "end of line"

How the code works: return 0 Program ran successfully Anything BUT 0 indicates error

Working with numbers We can output numbers to console: Can do math using + - / * Division may give interesting results…

Everything Counts Indentation & Style matter (to humans) Spelling & Capitalization matter (to humans & computers)