C++ Crash Course Class 1 What is programming?. What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.

Slides:



Advertisements
Similar presentations
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Advertisements

Programming Types of Testing.
COSC 120 Computer Programming
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
CIS105 Chapter 1 Theory Review. Page 2 Hardware and Software are the two major components o any computer system Hardware is the set of physical devices.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computers: Tools for an Information Age
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Introduction Algorithms and Programming. Computer Programming  A form of problem solving  Or, more accurately, a way to solve problems  What we will.
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.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
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: 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.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
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.
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Introducing Java.
Programming Languages: Telling the Computers What to Do Chapter 16.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Programming Translators.
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.
Computer Concepts 2014 Chapter 12 Computer Programming.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Chapter 1: Introduction to Computers and Programming.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Software Engineering Algorithms, Compilers, & Lifecycle.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Chapter 1 Introduction 2nd Semester H
CSCI-235 Micro-Computer Applications
Java programming lecture one
Programming Concepts and Languages
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Programming.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Programming Logic and Design Eighth Edition
Presentation transcript:

C++ Crash Course Class 1 What is programming?

What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.

What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine. Also: understand what it means to program, understand a bit better how computers work, and be better equipped with the ability to learn how to make the computer do what you want it to.

What is programming? Programs are a set of instructions for the computer Computers are DUMB Computer only understands binary, or specifically machine code, low-level code Programs are high-level, written for humans – C, C++, Ruby, Java, Perl, LISP… Programs have to be translated for the computer – Compiling vs. interpreting

What is programming? Programs typically must be written for a specific platform or operating system – Operating system: Windows 7, MacOSX, Red Hat – Platform: combination of the hardware architecture and software that runs on it We have several languages we could write in, all of which perform better with a certain purpose in mind

Procedural vs. Object-Oriented Procedural programming is linear: – Functions and procedures are pre-defined – When the program is run, it’s stepped through in a very straightforward manner Object-oriented models the everyday world: – With OOP, we can have a real-world object with attributes and methods – Agent object sends a message, and doesn’t know what will happen – Receiving object has to carry out instructions Code re-use is very important in both! – Crucial to understanding all programming

Programming Steps 1.Define the problem 2.Design the solution 3.Program code 4.Testing 5.Deployment

Programming Steps 1.Define the problem – What are we trying to accomplish? Why is this program being written? 2.Design the solution 3.Program code 4.Testing 5.Deployment

Programming Steps 1.Define the problem 2.Design the solution – What structure do we need? (functions, objects) – What algorithms will we use? – Write pseudocode – Test the algorithm on paper – what inputs does it need? Where will it fail? 3.Program code 4.Testing 5.Deployment

Programming Steps 1.Define the problem 2.Design the solution 3.Program code – Type it up, compile, repeat – Pre-processing: include files, definitionsCompile: turn source code to assembly to machine or object code – Link with library routines – Load in memory 4.Testing 5.Deployment

Programming Steps 1.Define the problem 2.Design the solution 3.Program code 4.Testing – Execute the program: run in the CPU (Central Processing Unit) – Black box testing – White box testing – Unit testing 5.Deployment

Programming Steps 1.Define the problem 2.Design the solution 3.Program code 4.Testing 5.Deployment – Once we’ve tested sufficiently, we can put the code into the real world!

Programming Steps 1.Define the problem 2.Design the solution 3.Program code 4.Testing 5.Deployment – Once we’ve tested sufficiently, we can put the code into the real world! Repeat steps as necessary: code is rarely, if ever, perfect after the first run

What is a program? Learning to program is a little like learning a foreign language. vocabulary: reserved words, or things the compiler or interpreter already understands also includes user-created identifiers, naming things for the compiler or interpreter grammar: syntax rules guiding understanding

What is a program? Tokens – Comments: for humans; tells a reader of the code what it’s supposed to be doing – Keywords: words used by the language; you’re not allowed to redefine these – Identifiers: words you make up to refer to concepts you’ve written into the code (variables, functions) – Literals: explicit references in the code to numbers or strings (known as “hard-coding”) – Symbols: operators or punctuation in the code

What is a program? Written in hierarchical chunks – Preprocessor statements – Comments – Collection of functions… …which are collections of statements …which are collections of tokens.

What is a program? Let’s write one! The problem: average three numbers

Error types Compilation error: – You made a mistake that makes it impossible for the compiler to figure out what you meant! – Identifiable when the compiler complains. Run-time error: – The compiler was successful, but you made a mistake that makes it impossible for the computer to finish running the program! – Identifiable when you get a complaint when running the program. Logic error: – Your program compiles and runs, but your input produces the wrong output! – Identifiable by doing a program trace and figuring out what the program was supposed to spit out. All of these mean it’s time for debugging.

Homework Student survey on Blackboard – fill it out by tomorrow! Written HW #1 and project #1 due Thursday – Will be up on the course website later tonight