0% found this document useful (0 votes)
215 views3 pages

Project in Computer: Submitted by

This document contains an introduction to C++ programming. It defines C++ as an object-oriented extension of the C programming language. It provides examples of "Hello World" and inch-centimeter conversion code in C++. It also describes some common uses of C++, such as for device drivers, teaching/research, and in many application domains.

Uploaded by

Jungkookie Bae
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
215 views3 pages

Project in Computer: Submitted by

This document contains an introduction to C++ programming. It defines C++ as an object-oriented extension of the C programming language. It provides examples of "Hello World" and inch-centimeter conversion code in C++. It also describes some common uses of C++, such as for device drivers, teaching/research, and in many application domains.

Uploaded by

Jungkookie Bae
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

PROject

In
Computer
Submitted by:
Ma. Clarissa D. ham
Submitted to:
Mr. Albert Reyes

DEFINITION

C++ is an object oriented programming (OOP) language, developed by Bjarne Stroustrup, and is an extension of C
language. It is therefore possible to code C++ in a "C style" or "object-oriented style." C++ is a general purpose
object oriented programming language. It is considered to be an intermediate level language. C++ is statically type,
compiled, gnereal purpose ,case sensitive, free-form programming language that supports procedural, object oriented
and generic programming.

INTRODUCTION

C++ was developed by Bjarne Stroustrup of AT&T Bell Laboratories in the early 1980's, and is based on the C
language. The "++" is a syntactic construct used in C (to increment a variable), and C++ is intended as an
incremental improvement of C. Most of C is a subset of C++, so that most C programs can be compiled (i.e.
converted into a series of low-level instructions that the computer can execute directly) using a C++ compiler.
C++ is superset of C , and that virtually any legal C program is a legal C++ programs.

USES

C++ used by hundreds of thousands programmer is essential every application domain. C++ is being highly
used to write device drivers and other software that rely on direct manipulation of hardware under real time
constraints. C++ is widely used for teaching and research because it is clean enough for successful teaching of
basic concepts.

SAMPLE CODES
// The Hello world program.
// pg 46, sec 3.2, Hello, World!
// No guarantees offered. Constructive comments to [email protected]
#include <iostream>
int main()
{
std::cout << "Hello, world!\n";
}
// note that "return 0;" isn't required in ISO C++

// Simple inch<->cm conversion program illustrating basic I/O and computation.


// pg 50, sec 3.6, Input
// No guarantees offered. Constructive comments to [email protected]

#include<iostream>
using namespace std;

int main()
{
const float factor = 2.54;
float x, in, cm;
char ch = 0;

// 1 inch equals 2.54 cm

cout << "enter length: ";


cin >> x;
cin >> ch;

// read a floating-point number


// read a suffix

switch (ch) {
case 'i':
// inch
in = x;
cm = x*factor;
break;
case 'c':
// cm
in = x/factor;
cm = x;
break;
default:
in = cm = 0;
break;
}
cout << in << " in = " << cm << " cm\n";
return 0;
}

// redundant in ISO C++

You might also like