Professional Documents
Culture Documents
Structured Programming Week1
Structured Programming Week1
9/11/2013
What is programming?
SJEM 2231
Structured Programming
LECTURE NOTES (WEEK 1)
BY
DR NOOR FADIYA MOHD NOOR
What is syntax?
9/11/2013
What is semantic?
What is C programming?
Designing A Program
9/11/2013
C++ Editor/Compiler
i.e. Lab1.cpp
A compiled file has similar name with source
code but with .exe extension i.e. Lab1.exe
Microsoft
Visual C++
9/11/2013
2. In the start-
3. Select
up screen
go to File
> New >
Project."
Win32
Console
Application.
4. Name your
project and
save it i.e
trial
5. Select
empty
project
9/11/2013
6. Open the
workspace
7. Add a
source
code, go to
Project >
Add To
Project >
New
as i.e.
Lab1.cpp
and open it
9/11/2013
9. Write a
simple
program
program.
11. Click ! to
run the
program.
Select Yes
to build the
program
9/11/2013
A Program Structure
A Program Structure
comment
#include <iostream>
using namespace std;
declaration
int main ()
{ cout << I am a C++ beginner!;
return 0; }
execution
A Program Structure
A Program Structure
#include <iostream>
9/11/2013
A Program Structure
A Program Structure
int main ()
A Program Structure
return 0; }
This return statement causes the main function
to be ended.
A return code of 0 indicates that the program
is working without errors.
} indicates the ending point of the main
function.