VBE-Introduction to VB Express

download VBE-Introduction to VB Express

of 16

Transcript of VBE-Introduction to VB Express

  • 8/11/2019 VBE-Introduction to VB Express

    1/16

    KEMENTERIAN PELAJARAN MALAYSIAKEMENTERIAN PELAJARAN MALAYSIA

    Self Access LearningSelf Access LearningModuleModule

    Visual BasicVisual BasicExpressExpress

    Introduction toIntroduction toprogrammingprogramming

    ICT Literacy forICT Literacy forSecondary SchoolSecondary School

    PrograProgra

  • 8/11/2019 VBE-Introduction to VB Express

    2/16

    PUSAT PERKEMBANAGN KURIKULUM

    KEMENTERIAN PELAJARAN MALAYSIA

  • 8/11/2019 VBE-Introduction to VB Express

    3/16

    ICTL for Secondary School - Visual Basic Express Module

    In!roduc!ion !o prograing

    Learning objectives:

    At te en! o" tis #esson$ %o& so! be ab#e to:

    '( !e"ineprogramming;an!

    )( state te *ain ste+s in +rogra**e !eve#o+*ent(

    '(' ,at is +rogra**ing-

    Programming language is a set o" res tat +rovi!es a .a% o" te##ing te

    co*+&ter .at o+eration to +er"or*( /accor!ing to 0a+ron an! Jonson$)1123

    '() ,at +rogra**ing #ang&ages are avai#ab#e-

    Be"ore #oo4ing at a s+eci"ic +rogra**ing #ang&age$ .e nee! to 4no. te #eve#s o"+rogra**ing #ang&ages(

    Lang&age is sai! to be 5#o.er6 or 5iger6 !e+en!ing on o. c#ose te% are to te#ang&age te co*+&ter itse#" &ses or to te #ang&age +eo+#e &se /*ore Eng#is7#i4e7ig3(

    Tese +rogra**ing #ang&ages are genera##% !ivi!e! into "ive #eve#s or generations:

    i3 Macine Lang&ageii3 Asse*b#% Lang&ageiii3 8ig7Leve# Lang&ageiv3 9er% 8ig7Leve# Lang&agev3 Nat&ra# Lang&age

    Te "o##o.ing are te !escri+tions o" eac #eve# o" +rogra**ing #ang&age:

    Level of language Descriptions

    Macine Lang&age 7U#ti*ate#% te co*+&ter &n!erstan!s on#%binar% n&*ber7strings o" 1s an! 's(7Progra*s tat are .ritten in tese 1s an! 'sre+resent te 5on6 an! 5o""6 e#ectrica# stateso" co*+&ter7A## oter #ang&ages *&st be trans#ate! into*acine #ang&age be"ore eec&tinginstr&ctions(

    1

  • 8/11/2019 VBE-Introduction to VB Express

    4/16

    ICTL for Secondary School - Visual Basic Express Module

    Asse*b#% Lang&age7Tis +rogra**ing #ang&age is consi!ere!ver% #o. #eve#(7Tis #ang&age &se *ne*onic co!es$abbreviations tat are eas% to re*e*bers&c as: A "or a!!$ 0 "or co*+are$ MP "or*ti+#% an! so on(

    8ig7 Leve# Lang&age 7;or tis #ang&age$ +rogra**ers no #ongernee! to ave !etai#e! 4no.#e!ge o"co*+&ter ar!.are to +ro!&ce a+rogra**e(7 Tis #ang&age is c#oser to &*an #ang&ageco*+are to te *acine #ang&age(

    9er% 8ig7Leve# Lang&age 7>

    3 JA9A

    2

  • 8/11/2019 VBE-Introduction to VB Express

    5/16

  • 8/11/2019 VBE-Introduction to VB Express

    6/16

    ICTL for Secondary School - Visual Basic Express Module

    b3 Ea*+#e o" 9is&a# Basic ta4en "ro* /...(!*st(a&eb(gr@!!s@etec@s.!ev@env(gi"3 ''()1@'C(C()11C

    c3 Ea*+#e o" Pasca# ta4en "ro*/tt+:@@...("ree!o.n#oa!!eve#o+*ent(co*@!e#+i@+asca#7#oo4(t*#3ti*e''()1@'C(C()11C(

    4

    http://www.freedownloaddevelopment.com/delphi/pascal-look.html)%20http://www.freedownloaddevelopment.com/delphi/pascal-look.html)%20
  • 8/11/2019 VBE-Introduction to VB Express

    7/16

    ICTL for Secondary School - Visual Basic Express Module

    !3 Ea*+#e o" 0 +rogra**ing ta4en "ro*/tt+:@@...(origin#ab(co*@...@+ro!&cts@i*ages@originDcDco!eD2)+(gi"3''(=1@'C(C()11C

    5

    http://www.originlab.com/www/products/images/origin_c_code_492px.gifhttp://www.originlab.com/www/products/images/origin_c_code_492px.gif
  • 8/11/2019 VBE-Introduction to VB Express

    8/16

    ICTL for Secondary School - Visual Basic Express Module

    e3 Ea*+#e o" ;otran +rogra**ing ta4en "ro*tt+:@@o*e+age(cs(&ri(e!&@"act%@.o#"e@boo4@Rea!ings@Rea!ing'=(t* 3'':=1@'C(C()11C

    6

    http://homepage.cs.uri.edu/faculty/wolfe/book/Readings/Reading13.htmhttp://homepage.cs.uri.edu/faculty/wolfe/book/Readings/Reading13.htm
  • 8/11/2019 VBE-Introduction to VB Express

    9/16

    ICTL for Secondary School - Visual Basic Express Module

    "3 Ea*+#e o" 0>> +rogra**ing ta4en "ro*/tt+:@@...(co!ec&tter(net@too#s@F&inc%@screen&*+(gi"3'':=1@'C(C()11C

    7

    http://www.codecutter.net/tools/quincy/QscreenDump.gif)11:30/16.6.2006http://www.codecutter.net/tools/quincy/QscreenDump.gif)11:30/16.6.2006
  • 8/11/2019 VBE-Introduction to VB Express

    10/16

    ICTL for Secondary School - Visual Basic Express Module

    g3 Ea*+#e o" Java +rogra**ing ta4en "ro*/tt+:@@ssr#ibrar%(ca@H*egatron@i*ages@screensots@ec#i+se(+ng3'':=1@'C(C()11C

    8

    http://ssrlibrary.ca/~megatron/images/screenshots/eclipse.png)11:30/16.6.2006http://ssrlibrary.ca/~megatron/images/screenshots/eclipse.png)11:30/16.6.2006
  • 8/11/2019 VBE-Introduction to VB Express

    11/16

    ICTL for Secondary School - Visual Basic Express Module

    The Program Development Life Cycle

    ,en .e .ant to +ro!&ce a +rogra*$ .e nee! to go tro&g a "e. +ases( Tere are"ive *ain +ases in +rogra* !eve#o+*ent

    Let?s #oo4 at te !escri+tions o" eac *ain +ase in +rogra* !eve#o+*ent:

    1. Problem Analysis

    What is problem analysis?

    Yo& nee! to i!enti"% te +rob#e* be"ore !eve#o+ing a +rogra*( Let?s i*aginetat %o& are a +rogra**er(

    As a +rogra**er$ %o& are contacte! beca&se %o&r services are nee!e!( Yo&*eet .it &sers "ro* te c#ient organiation to ana#%e te +rob#e*$ or %o& *eet.it a s%ste*s ana#%st .o o&t#ines te +roject( S+eci"ica##%$ te tas4 o" !e"iningte +rob#e* consists o" i!enti"%ing .at it is %o& 4no. /in+&t7given !ata3$ an!.at it is %o& .ant to obtain /o&t+&t7te rest3( Event&a##%$ %o& +ro!&ce a .rittenagree*ent tat$ a*ong oter tings$ s+eci"ies te 4in! o" in+&t$ +rocessing$ an!o&t+&t reF&ire!( Tis is not a si*+#e +rocess(

    9

    PHA! 1

    ProblemAnalysis

    PHA! "

    PHA! #PHA! $

    PHA! %

    Program

    Design

    Co&ingThe problemTesting an&Debugging

    Documenting

    TheProgramme

  • 8/11/2019 VBE-Introduction to VB Express

    12/16

    ICTL for Secondary School - Visual Basic Express Module

    ". Program DesignIn tis +ase$ %o& .i## !o te "o##o.ing tas4s:

    P#an te so#&tion to te +rob#e* /tin4 abo&t o. .i## %o& so#ve te +rob#e*3

    0oose te inter"ace /tin4 abo&t o. .i## %o&r +rogra* #oo4 #i4e3

    #. Co&ing

    So no. %o& are rea!% to .rite te co!e o" te +rogra* tat %o& ave +#anne!(Yo& nee! to e+ress %o&r so#&tion in a +rogra**ing #ang&age(

    Te nor*a# +rocess %o& .i## go tro&g is to trans#ate te #ogic "ro* te "#o.cartor +se&!oco!e7or so*e oter too#7to a +rogra**ing #ang&age( Te "o##o.ing areea*+#es o" bot too#s:

    a3 Ea*+#e o" a "#o. cart

    10

  • 8/11/2019 VBE-Introduction to VB Express

    13/16

    ICTL for Secondary School - Visual Basic Express Module

    b3 Ea*+#e o" +se&!o co!e /tat re"#ects te "#o.cart so.n3

    As .e ave a#rea!% note!$ a +rogra**ing #ang&age is a set o" res tat+rovi!es a .a% o" instr&cting te co*+&ter .at o+erations to +er"or*( Tere are

    *an% +rogra**ing #ang&ages: BASI0$ 0

    20

    DISPLAY sum

  • 8/11/2019 VBE-Introduction to VB Express

    14/16

    ICTL for Secondary School - Visual Basic Express Module

    Sti##$ tere are *an% o++ort&nities to intro!&ce *ista4es into +rogra*s$ an!%o&$ j&st as tose .o ave gone be"ore %o&$ .i## +robab#% "in! severa# o"te*(Why &ebug?

    Yo& nee! to !eb&g to i*+rove %o&r +rogra*( eb&g is a ter* &se!

    etensive#% in +rogra**ing( 5eb&gging6 *eans !etecting$ #ocating$ an!correcting b&gs /*ista4es3$ &s&a##% !one b% r&nning te +rogra*(

    Tese b&gs are #ogic errors$ s&c as te##ing a co*+&ter to re+eat ano+eration b&t not te##ing it o. to sto+ re+eating( In tis +ase %o& r&n te+rogra* &sing test !ata tat %o& !evise( Yo& *&st +#an te test !ata care"#%to *a4e s&re %o& test ever% +art o" te +rogra*(

    Ho' &o you &ebug?

    Yo& can carr% o&t !eb&gging b% r&nning te +rogra*( Te "o##o.ing areea*+#es o" !eb&gging "or 9is&a# Basic E+ress an! J&st BASI0(

    a3 !eb&gging b&tton in 9is&a# Basic E+ress

    b3 !eb&gging b&tton in J&st BASI0 v'(1'

    12

  • 8/11/2019 VBE-Introduction to VB Express

    15/16

    ICTL for Secondary School - Visual Basic Express Module

    %. Documentation

    oc&*entation is i*+ortant .en +rogra**ing( oc&*enting is anongoing$ necessar% +rocess$ a#to&g$ as *an% +rogra**ers are$ %o& *a%be eager to +&rs&e *ore eciting co*+&ter7centere! activities(

    What is &ocumentation?

    oc&*entation is a .ritten !etai#e! !escri+tion o" te +rogra**ing c%c#ean! s+eci"ic "acts abo&t te +rogra*( T%+ica# +rogra* !oc&*entation*ateria#s inc#&!e te origin an! nat&re o" te +rob#e*$ a brie" narrative!escri+tion o" te +rogra*$ #ogic too#s s&c as "#o.carts an! +se&!oco!e$!ata7recor! !escri+tions$ +rogra* #istings$ an! testing rests(

    0o**ents in te +rogra* itse#" are a#so consi!ere! an essentia# +art o"!oc&*entation( Man% +rogra**ers !oc&*ent as te% co!e( In a broa!ersense$ +rogra* !oc&*entation can be +art o" te !oc&*entation "or anentire s%ste*(

    Te .ise +rogra**er contin&es to !oc&*ent te +rogra* tro&go&t its!esign$ !eve#o+*ent$ an! testing( oc&*entation is nee!e! to s&++#e*ent&*an *e*or% an! to e#+ organie +rogra* +#anning( A#so$!oc&*entation is critica# to co**&nicate .it oters .o ave an interest inte +rogra*$ es+ecia##% oter +rogra**ers .o *a% be +art o" a+rogra**ing tea*(

    13

  • 8/11/2019 VBE-Introduction to VB Express

    16/16

    ICTL for Secondary School - Visual Basic Express Module

    ,ritten !oc&*entation is nee!e! in co*+&ter in!&str% so tat tose .oco*e a"ter %o& can *a4e an% necessar% *o!i"ications in te +rogra* ortrac4 !o.n an% errors tat %o& *isse!(

    14