WEEKLY REFLECTION 2
- Mencari perbezaaan antara procedural programming , structured programming dan object oriental programming ke dalam forum http://lect-ayuni.forumms.net.
- Belajar Chapter 2 C++ Programming Language.
- Chapter 2 Miss mengajar program layout dan perlu memahami bagi untuk tulis di dalam weekly reflection 2.
- Kemudian telah memberikan tugasan secara group iaitu Sum and Minus Two Integers.CHAPTER 2 C ++ BASICS
2.1 C++ LANGUANGE
- The C ++ language consists of the to two basic elements :
a) Semantics
b) Syntax
- Semantics is a vocabulary of commands that humans can understand and that can converted into machine language.
- Syntax is a language structure (or grammar ) that allows humans to combine these C++ commands into a program that actually does something.
- Example, let’s look at the common a English sentences below:-
1- Data Type
Int Integer - real 0-9
Float float }-decimal
Double double
Const constant - formula akan menjadi static
Char character - one alphabet only a-z / z-a
String string - one or more word
2- Input
Output/display – cout << please enter your = ;
Radius
Input – cin >> radius ;
3- Output ∕ Variable name
Cout << “area = “ << area ;
In body variable ;
To declare variable / semikolom
Data type variable_name ;
For Example :-
Π = 3.145 * radius * radius
#include<lostream.h>
Main ()
{
//declare variable
Float Pi;/r 1 / float Pi r 1 ;
Float radius ; r 2 radius ;
“Input radius
(But << “ Enter radius= “;
Cin >> radius ;
//Formula
PI = 3.145 * radius * radius
//Output
Cout << “Area ; =” << Pi ;
Return 0 ;
}
2.2 C++ PROGRAM
- C++ program is a text file containing a sequence of C++ commands put together a according to the laws of C++ grammas.
KEY ITEMS | EXPLANATION |
C++ Command | The building blocks of the C++ program. |
C++ Grammar | A correct and valid C++ language construct, structure or rules. |
C++ Program | A text file containing a sequence of C++ Command that does something. |
C++ Source file | A text file that carries the extension. CPP. |
Editor | A software tool to create and modify text files. |
Compiler | A program that translates a C++ Program into a machine-language program that the computer can directly understand and executes. |
Machine Executable File | A program that the computer can directly understand executes. |
IDE (Integrated Development Environment ) | A software development tool that combines the compiler and the editor into a single package. It provides the windows, editors and controls for editing, compiling and debugging the code |
No comments:
Post a Comment