Title | Lecture Notes in Computer Fundamentals and Programming |
---|---|
Course | Programming Languages |
Institution | Polytechnic University of the Philippines |
Pages | 10 |
File Size | 625.4 KB |
File Type | |
Total Downloads | 381 |
Total Views | 546 |
LECTURE NOTES IN COMPUTER FUNDAMENTALS AND PROGRAMMING [ C++ ] Computer Programming – a process of implementing the algorithm using a language that computer can understand. Indentifiers – “representations” Letters (a – z, A – Z) Digits (0 – 9) Underscore ( _ ) An identifier must begin with a l...
LECTURE NOTES IN COMPUTER FUNDAMENTALS AND PROGRAMMING [ C++ ]
Computer Programming – a process of implementing the algorithm using a language that computer can understand. Indentifiers – “representations”
Letters (a – z, A – Z)
Digits (0 – 9)
Underscore ( _ )
An identifier must begin with a letter or an underscore. [C++ is case sensitive] Variable – the symbolic name for a location of memory referenced by an identifier that contains data that may change during execution. Data Types:
Char – one alphanumerical character [‘a’, ‘!’, ‘C’, ‘1’]
Int – positive or negative integers with/ without a sign [25, -100, 0]
Float – integer part and a fractional part [25.00, -3.75, 2.523]
String – used to hold data containing one or more than one character Example: string abc = “Hello”; char abc[5] = “Hello”;
BASIC STRUCTURE OF A C++ PROGRAM 1. Preprocessor Directives – information of the program needs 2. Heading –function by definition to return a value 3. Main Function – consists of named constant declarations, variable declarations and executable statements
BASIC INPUT/OUTPUT IN C++ General Form: cin>>variable1>>variable2>>…; cout...