n from what language did c++ originate? n what’s input, output device? n what’s main memory,...

8
from what language did C++ originate? what’s input, output device? what’s main memory, memory location, memory address? what’s a program, data? what’s natural language, high-level language, machine language what’s compiler, linker, library? what’s source/object/executable code? Computer Terms Review

Upload: bruce-emil-atkins

Post on 04-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 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?

from what language did C++ originate? what’s input, output device? what’s main memory, memory location, memory address? what’s a program, data? what’s natural language, high-level language, machine

language what’s compiler, linker, library? what’s source/object/executable code?

Computer Terms Review

Page 2: 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?

The Fundamentals of C++

First programsDevelopment Environment

Page 3: 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?

Program structure First programs

hello, world calculating the area of a rectangle

Eclipse Subversion

Program Organization

Page 4: 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?

Program written in human-readable from is called source program - extension - .cpp (helloworld.cpp)

compiler is applied to the source program to translate it into form machine understands - we use g++ (GNU C++ compiler)

compiler may produce either object code - direct translation of the source program - extension o. (helloworld.o)

compiler (actually linker) adds all other necessary parts for the program to run on a computer and produces executable code (a.out or any name you like)

specially produced executables can be traced (more on that later)

Programming Cycle

Page 5: 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?

// Program: Display greetings// Author: Wayne Cheng// Date: 6/01/2011#include <iostream>

using namespace std;

int main() { cout << "Hello,world!" << endl; }

A First Program - Greeting.cpp

preprocessor directive

outputstatement

comments

function named main

indicates start of

program

name collision protection

Page 6: 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?

variabledeclarations

input

output

#include <iostream>

int main() { // Extract length and width cout << "Rectangle dimensions ";

int length;

int width;

cin >> length >> width;

// Compute and insert the area

int area;

area = length * width;

cout << ”Area = " << area << " = length "

<< Length << " * Width " << width << endl;

}

computation

Page 7: 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?

Eclipse is an integrated development environment (IDE) for writing, debugging, testing and running programs

C/C++ development toolkit (CDT) is used to develop C++ programs in Eclipse. Eclipse basic concepts

workbench - is a collection of panels (called views) for programming tasks. CDT provides a C/C++ workbench.

view - is a panel dedicated to a specific task. ex: editor view to edit source files, console view to display compiler or program outputs

perspective - a set of specially arranged views for the particular tasks. Two most important perspectives in CDT are C/C++ and debug.

project - a set of files that are developed jointly. A project compiles into a single executable. A Project Explorer view lists all the projects in the workbench

toolchain - a compiler and other supporting tools that compile the source program into executable and help debug it. We use g++ which is part of Gnu Compiler Collection (GCC) toolchain

Eclipse

Page 8: 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?

subversion – version control software used by programmers for team code development. We use for lab submission and grading has centralized code repository C++ projects can be: added to repository, checked out and committed repository is accessible from the web method to verify submission

Subclipse is an extension of Eclipse that allows it to interact with Subversion. It comes with its own Team Synchronization perspective. However, most of the functionality is accessble from the standard C/C++ CDT perspective.

Subversion