Instructor: Tina Tian. About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or .

Slides:



Advertisements
Similar presentations
C++ Introduction.
Advertisements

Module 6: Introduction to C Language ITEI102 Introduction to Programming Structure of C++ Program - Programming Terminologies - Microsoft Visual Studio.
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
Instructor: Tina Tian. General Info Office: RLC 203A Office Hours: Tuesday, Friday 1:00 – 2:00 PM.
INTRODUCTION T.Najah Al_Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System CS240.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
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.
Chapter 1 Introduction to Computers and C++ Programming.
Wednesday, 9/4/02, Slide #1 1 CS 106 Intro to CS 1 Wednesday, 9/4/02  Today: Introduction, course information, and basic ideas of computers and programming.
Tuesday, December 05, 2006 I hear and I forget, I see and I remember, I do and I understand -Chinese Proverb.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
C programming Language and Data Structure For DIT Students.
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.
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.
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)
Introduction COMP104: Fundamentals and Methodology.
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
Intro. to Game Programming Want to program a game?
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Introduction to Computers and C++ Programming.
Hello World 2 What does all that mean?.
Outline  History  What is C++  How does C++ relate to other OO languages  Types of applications for C++  Components of MS’s Visual C  Advantages.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Copyright © 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Introduction to Computers and C++ Programming.
Chapter 11 An Introduction to Visual Basic 2008 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Introduction to C++ Programming Language
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Copyright © 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Mohamed Iqbal Pallipurath Slide 1. Mohamed Iqbal Pallipurath Slide 2 Basics Introduction to Computers and C++ Programming.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Course Title: Introduction to C++ Course Instructor: ADEEL ANJUM Chapter No: 01 1 BY ADEEL ANJUM (MCS, CCNA,WEB DEVELOPER)
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?
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
Chapter 11 An Introduction to Visual Basic 2005 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
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?
Chapter 0 Getting Started. Objectives Understand the basic structure of a C++ program including: – Comments – Preprocessor instructions – Main function.
Monday, Jan 6, 2003Kate Gregory with material from Deitel and Deitel CO 204 Object Oriented Programming 2003 Trent University Kate Gregory.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 05, 2005 Lecture Number: 4.
Copyright © 2012 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
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.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Computers and C++ Programming.
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
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.
Copyright © 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics.
1 Structure of Simple C++ Program Chapter 1 09/09/13.
CMPT 238 Data Structures Instructor: Tina Tian. General Information Office: RLC 203A Office Hour: Tue and Fri 12:30 - 2:00PM.
Software Engineering Algorithms, Compilers, & Lifecycle.
CMPT 463 Artificial Intelligence Instructor: Tina Tian.
CMPT 201 Computer Science II for Engineers
Foundations of Computer Science C & C++ programming lecture 2
Introduction to Computers and C++ Programming
Topic Pre-processor cout To output a message.
CMPT 201.
Computer Terms Review from what language did C++ originate?
Beginning C++ Programming
CMPT 238 Data Structures Instructor: Tina Tian.
C++ Programming: From Problem Analysis to Program Design
CS190/295 Programming in Python for Life Sciences: Lecture 1
Programming 1 (CS112) Dr. Mohamed Mostafa Zayed 1.
CS IA: Procedural Programming CS IB: Object-Oriented Programming
Computer Terms Review from what language did C++ originate?
COMS 261 Computer Science I
CMPT 420 / CMPG 720 Artificial Intelligence
CMPT 238 Data Structures Instructor: Tina Tian.
Presentation transcript:

Instructor: Tina Tian

About me Office: RLC 203A Office Hours: Wednesday 1:30 - 4:30 PM or for appointment Website: home.manhattan.edu/~tina.tian/

About the Course Monday, Thursday 1:30 - 2:45 PM RLC 104 Textbook: Gaddis 8 th Edition (preferred) Gaddis 7 th Edition Grading: 1 st Midterm Exam (5 th week)15% 2 nd Midterm Exam (10 th week)15% Final Exam30% Lab Assignments and Homework 40%

Homework Assignments All are programming. Expect homework Each homework may contain several programming problems. Homework is due a week after being announced. No late work is accepted.

Homework Assignments Hard copy electronic copy will not be accepted Source code Screen shot of output/test run

Advices Stay close to the computers and try out the example programs! You can work as a team but don’t copy code. Save your programs home.manhattan.edu s flash drive

About MS Visual Studio Integrated Development Environment (IDE) Used to develop console and graphical user interface (GUI) applications Supports C/C++, C#, VB, etc. Visual Studio 2012 Professional (lab) Visual Studio Express: Community 2015 (Free to download onto personal computers)

If you are using Mac.. Xcode Free Compiler

About C++ High-level language e.g., C++, C, Java, Python, PHP, Visual Basic... Designed to be easy to read and write Low-level language e.g., assembly language ADD X Y Z Assembly language must be translated to machine language (zeros and ones) Any high-level language program must be translated into machine language for the CPU to execute.

Compilers A program that translates a high-level language to a machine language Source code The original program in a high level language Object code The translated version in machine language

Linkers Some programs we use are already compiled Their object code is available for us to use For example: Input and output routines A Linker combines The object code for the programs we write and The object code for the pre-compiled routines into The machine language program the CPU can run

Algorithms Algorithm A sequence of precise instructions that leads to a solution Program An algorithm expressed in a language the computer can understand

Desktop testing: mentally going through the algorithm Testing: running the program on sample input data

Object Oriented Programming (OOP) Used for many modern programs Program is viewed as interacting objects Procedural vs. OOP

Some history of C++ C++ is derived from C. C developed by Dennis Ritchie at AT&T Bell Labs in the 1970s. Used to maintain UNIX systems a high-level language with many of the features of a low-level language Good for writing system programs, but hard to understand C++ developed by Bjarne Stroustrup at AT&T Bell Labs in the 1980s. Overcame several shortcomings of C Incorporated object oriented programming C remains a subset of C++

Include Directives #include Preprocessor directive iostream is a library containing definitions of the input and output function Linker Appears at the start of the program, begin with # using namespace std; Tells the compiler to use names in iostream in a “standard” way

int main() {//beginning of the main function....//statements return 0; }//end of the program

The output function cout c(C++ language)out(output) c(C++ language)in(input) cout<<whatever data you want to output; cout<<“Welcome to CMPT102!”; << represents the flow of the data.

Okay, let’s write a hello world program in C++ C++ is fun!

Note No extra space between #include Old C++ compilers: iostream.h Statements end with a semi-colon.

Program Layout Compiler accepts almost any pattern of line breaks and indentation Programmers format programs so they are easy to read Place opening brace ‘{‘ and closing brace ‘}’ on a line by themselves Indent statements Use only one statement per line

.cpp file.exe file

More about cout <<: insertion operator cout<<“Hello World”; is equivalent to cout<<“Hello”<<“ World”; is equivalent to cout<<“Hello ”; cout<<“World”;

About cout Start a new line \n (need to go inside of the quotes) endl Escape sequence \nnew line \ttab \”“ \\\

Comments // This is a comment. /* This is a comment. This is another comment. */

Exercise Write a simple program to print to the screen the following. Be sure to add your name in the comment. Hello! I say “C++ is fun!” Good-bye!

Readings Chapter 2 Download and install Visual Studio