C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Lecture 1: Intro to Computers Yoni Fridman 6/28/01 6/28/01.
Computers: Tools for an Information Age
HST 952 Computing for Biomedical Scientists Lecture 2.
Russell Taylor Lecturer in Computing & Business Studies.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
Guide To UNIX Using Linux Third Edition
Chapter 1 Program Design
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Java How to Program, 9/e Instructor: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
Introduction 01_intro.ppt
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
Programming Languages: Telling the Computers What to Do Chapter 16.
A First Program Using C#
Introduction COMP104: Fundamentals and Methodology.
CS110/CS119 Introduction to Computing (Java)
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Object-oriented programming and software development Lecture 1.
CS 122 Engineering Computation Lab Lab 2 Dan De Sousa and Tim Cheeseman Department of Computer Science Drexel University April 2009 ©By the author. All.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Computer Concepts 2014 Chapter 12 Computer Programming.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Introduction to Data Structures
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Class 1: What this course is about. Assignment Read: Chapter 1 Read: Chapter 1 Do: Chapter 1 ‘workbook’ pages not finished in class Do: Chapter 1 ‘workbook’
1 CSC 222: Object-Oriented Programming Spring 2013 Course goals:  To know and use basic Java programming constructs for object- oriented problem solving.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
1 CS210 Intermediate Computing with Data Structures (Java) Saaid Baraty S-3-90.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Software Engineering Review CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science.
Makefiles, Geany CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
WELCOME to CS244 Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin -
1.
CS-303 Introduction to Programming
Introduction to OOP CPS235: Introduction.
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.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Reading from a file, Sorting, and a little Searching Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics,
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Java How to Program, 9/e Presented by: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Software Engineering Algorithms, Compilers, & Lifecycle.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
CSC 222: Object-Oriented Programming
CSC 222: Object-Oriented Programming
Development Environment
Programming paradigms
CSC 222: Computer Programming II
Introduction to Eclipse
Sections Basic Concepts of Programming
CSCI-235 Micro-Computer Applications
CSC 222: Object-Oriented Programming
Programming COMP104: Fundamentals and Methodology Introduction.
Introduction to Computer Programming
Computer Programming.
Subprograms and Programmer Defined Data Type
The Programming Process
Presentation transcript:

C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University of Wisconsin – Stout 2014

From Last Time Installed VMware Player and Ubuntu Linux – Is there anyone who missed that? – Is there anyone who it is not working for yet? – If you missed the first class then you want to speak with me after this class

Things to Note Some Class Activities will require you to drop box things into D2L – These typically are the graded activities Other class Activities are for your own benefit – Such as installing Ubuntu Linux

Also Note Your first homework is already posted online – Do NOT wait to the due date to start it There will be a test (soon) on your C++ knowledge – Start reviewing as soon as possible

Today’s Plan Set up some foundational groundwork stuff Review some C++ and programming Get some practice using Ubuntu Linux and g++

Start Marker General questions about the course? Next up – What is programming? – Object Oriented versus Structured – C++ Review and Intro to Ubuntu

Class Activity What is programming? – Helper Questions: Why do you write a program? What are you trying to do? How? Perhaps identify a simple example?

End Class Activity Take a survey of answers Write them on the board Go to next slide and continue

Something You Already Know What is programming? – Programming is taking A problem A set of data A set of functions – Then Finding a way to apply those functions to the data to get an answer to the problem –.–. Check board Does this equate?

Something You Already Know What is programming? – Programming is taking A problem – Find the area of a rectangle A set of data – length and width A set of functions – multiplication, addition, subtraction, division – Then Finding a way to apply those functions to the data to get an answer to the problem – area = length * width Example

Some New-ish Things A Data Structure is a way of organizing and accessing data – Need to store a list of numbers? Use an array of doubles An Abstract Data Type (ADT) is – A set of data – A set of operations that can be performed on the data An Algorithm is a step-by-step procedure for performing some task – Need to find the minimum number? Use an algorithm

Back to What You Already Knew Programming is taking – A problem Find the area of a rectangle – A set of data length and width – A set of functions multiplication, addition, subtraction, division Then – Finding a way to apply those functions to the data to get an answer to the problem area = length * width - An Abstract Data Type (ADT) A set of Data length and width A set of operations multiplication, addition, subtraction, division Use an Algorithm with the ADT to get an answer to the problem area = length * width

What is Programming – Summary Programming is – Taking a given problem – Selecting an appropriate Abstract Data Type Select the right tool – Applying the correct algorithm (using the selected ADT) to solve the problem Use the tool in an efficient and appropriate manner

Marker Slide Questions on: – What is programming? Next up – Object Oriented versus Structured – C++ Review and Intro to Ubuntu

More Stuff You Already Know Many ways to approach programming Two popular ways – Procedural (aka structured) – Object Oriented Guesses anyone?

Procedural (basic concept) The main program coordinates calls to procedures sending appropriate data as parameters Example Languages: – BASIC, Pascal, C, FORTRAN – Data and functions are contained in procedures

Object Oriented (basic concept) Objects in the program interact – Conceptually by sending “messages” to each other – Objects contain both data and operations to act on that data Example Languages: – Java, C++, Simula, Objective C, Smalltalk, Python

Object Oriented (characteristics) Encapsulation – Classes hold and can hide data and functions – Nobody else needs to know how they work – Outsiders only get the interface Inheritance – Objects can be derived from other objects class Truck is derived from class Vehicle Polymorphism Ability to assume different forms Pointers to a base class can point at derived classes – A pointer to SimplePerson can point to an Instructor or Student or SimplePerson

Object Oriented Supports Modular programming E.Z.(er) development Maintainability

Object Oriented (implementation) How languages have chosen to approach/allow object oriented design varies C++ – Supports both procedural and object oriented – Good for flexibility and usability – Why both? Derived from C

Object Oriented (implementation) How languages have chosen to approach/allow object oriented design varies C++ – Supports both procedural and object oriented – Good for flexibility and usability – Why both? Derived from C

Marker Slide Questions on: – What is programming? – Object Oriented versus Structured Next up – C++ Review and Intro to Ubuntu

Recall Details of C++ So we now move on to details – How is an executable file created? – Write a C++ program – Remember C++

Executable Files The file you run to launch a program is an executable file In Windows executables are typically named someProgName.exe In Linux the executable name used by g++ is a.out but can be specified to be almost any name and extension

Steps to an Executable Using an editor a programmer (you) write C++ source code saving it as a file or files After the source code is saved the programmer invokes a C++ compiler – an application that reads source code and translates it into an object file (.o or.obj) A linker then links the object file to external files as necessary (like library files) and creates the executable file (.exe in Windows)

Steps to an Executable Using an editor a programmer (you) write C++ source code saving it as a file or files After the source code is saved the programmer invokes a C++ compiler – an application that reads source code and translates it into an object file (.o or.obj) A linker then links the object file to external files as necessary (like library files) and creates the executable file (.exe in Windows)

Steps to an Executable Using an editor a programmer (you) write C++ source code saving it as a file or files After the source code is saved the programmer invokes a C++ compiler – an application that reads source code and translates it into an object file (.o or.obj) A linker then links the object file to external files as necessary (like library files) and creates the executable file (.exe in Windows)

Steps to an Executable Using an editor a programmer (you) write C++ source code saving it as a file or files After the source code is saved the programmer invokes a C++ compiler – an application that reads source code and translates it into an object file (.o or.obj) A linker then links the object file to external files as necessary (like library files) and creates the executable file (.exe in Windows)

Integrated Development Environment To assist in the creation of executables a programmer often uses an Integrated Development Environment (IDE) An IDE typically combines – an editor – a compiler – a linker – sometimes debugging and other tools – Examples: Visual Studio, Eclipse, Xcode, etc. g++ acts as both a compiler and a linker

Command Line (Terminal Window) Another way to invoke the compiler and linker is from the command line This is usually done when – there is no graphical environment available many engineering environments are NOT Windows/graphical – and/or when the program is only composed of one or two source files

Command Line (Terminal Window) Another way to invoke the compiler and linker is from the command line This is usually done when – there is no graphical environment available many engineering environments are NOT Windows/graphical – and/or when the program is only composed of one or two source files

For this class Our early projects will be command line compiled and linked We will then look at how to create a Makefile Then we will start using a very primitive IDE

In Class Assignment – Hello Take 10 to 20 minutes to – Create a HelloGameOver.cpp program Use whatever text editor you like – This time using gedit may be the easiest Use command line to invoke g++ to compile and link into an executable Submit the source code and resulting executable (tarred together) to D2L Each individual must submit something, but you may work together There may exist a document on D2L to help you – Check the In Class Assignment Folder, for file: ICA001_HelloGameOver.pptx Additional help may be found on D2L in the Helper Section – HowTo_CompileCPP_viaCommandLine.pdf

End In Class Assignment Hello You have now completed your first C++ program for this course AND know how tar and gzip the results Most of the time you will only need to submit the source code – the executable will be re-created for grading Be certain you submitted something to D2L

So far so good – Now you should practice and explore – Trivial Practice ica002_DieRoller – More challenging ica003_WordJumble ica004_SimplePerson

The End Or is it?