-seperti biase,kami diberi rehat selama 1 jam.
-selepas rehat,kami belajar Chapter 2 C++ Programming Language.
- belajar c++ basics iaitu c++ language,datatype n c++ program.
-selepas itu, PN.Ayuni memberi latihan kepada kami.
- 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.
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 ;
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
|