Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Modul ke:
Fakultas
FASILKOM
Program Studi
Sistem
Informasi
PEMOGRAMAN
VISUAL CLIENT SERVER
Form Variable, Data Type, Operator, Condition,
Iteration
Hariesa B.P, ST, MM
Module Overview
Variables
Variables
A variable represents a named location in memory for
piece of data. An application can access a piece of data
by using the variable it has been assigned to.
A varible has the following six facets:
Name : Unique identifier that refer to the variable in code
Address : Memory location of the variable.
Data type : Type and size of data that the variable can store
Value : Value at the address of the variable.
Scope : Define area of code that can access and use the
variable.
Lifetime : Period of time that a variable is valid and available for
use
Examples of variable
As a counter for loop structure
As Temporary storage for property values
As a container to store a value that was return from a function
Data Type
Data Type
Note :
C# is case sensitive. Variable MyData is not the same with
myData
Implicit Conversion
Explicit Conversation
Operators
Operators Assignment
Decision Statement
Using ? Or If Statement
Using ? Or If Statement
Practice
Right click on the solution name, Add new project, click visual C#, click windows, click windows form, give the
project name with latihan4
Right click on project name, click set as startup project
Create a New Form and name as DecisionForm
Field
Description
Name
DecisionForm
Text
StartPosition
CenterScreen
Decision Form
Properties Label
Field
Description
Name
label1
Text
Variabel 1
Name
Label2
Text
Variabel 2
Properties TextBox
Field
Description
Name
tbVar1
Name
tbVar2
Properties Button
Field
Description
Name
btnIf
Text
GO If
Name
btnItenary
Text
GO ?
Name
btnSwitch
Text
Go Switch
Iteration Statement
While Statement
Do Loop Statement
For Statement
Practice
Description
Name
IterationForm
Text
StartPosition
CenterScreen
Properties Label
Field
Description
Name
label1
Text
Nilai Awal
Name
label2
Text
Batas AKhir
Properties TextBox
Field
Description
Name
Name
Properties Button
Field
Description
Name
btnWhile
Text
While
Name
btnDo
Text
Do
Name
btnFor
Text
For
Reference
MCT 10266
MCT 2546
netIndonesia.net
MSDN
Terima Kasih