SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
Learning Module: Programming




1.     What is it?


       This is a learning module for a specific Learning Outcome as stipulated in
       the HSP that is :
       €   5.2       Program Development




2.     Who is it for?


       This module is for students who are taking the ICT subject as their elective
       and for those who are interested in ICT.




3.     What can be achieved?


       Upon completion of this module, you should be able to :
       €   Apply program development phases to solve problems




4.     Is previous knowledge necessary?


       No. The content of this module will enable you to acquire the knowledge.




     www.ppk.kpm.my                                                         < 1 >
Learning Module: Programming




TOPIC        :     5.2 Program Development

SUBTOPIC: 5.2.2          Develop A Program


LEARNING OUTCOMES

You should be able to:


5.2.2.1      apply program development phases to solve problems:
             A.    Phase 1 - Problem Analysis
             B.    Phase 2 - Program Design
             C.    Phase 3 - Coding
             D.    Phase 4 - Testing and Debugging
             E.    Phase 5 - Documentation


DURATION :         24 periods


REFERENCES :
1. Schneider, D.I. (2004). An Introduction to Programming Using Visual Basic
   6.0. Prentice Hall. New Jersey.
2. Behrouz A. Forouzan (2001). Computer Science, A Structured Programming
   Approach Using C, Brooks / Cole. California.
3. Timothy & Linda O’leary, (2007). Computing Essentials 2007, McGraw Hill,
   New York.
4. Garry B. Shelly (2007). Discovering Computers 2007. Thomson Course
   Technology, Massachusetts.




   www.ppk.kpm.my                                                    < 2 >
Learning Module: Programming




SUBTOPIC: 5.2.2            Develop A Program


A.      Phase 1 - Problem Analysis


LEARNING OUTCOMES
By using this module, you should be able to:
        1.   identify the problem; and
        2.   identify the input, processing and output.


DURATION :          4 periods


I).     READING ACTIVITY


a).     What is problem analysis?


We solve all kinds of problems in our daily life. A problem may involve how to
commute to school, work or which homework to do first. Programming is the
same. You need to make a clear statement of the problem you are trying to solve.


b).     What should you do in this process?


To define a problem is the most difficult and important part of a programming
project. Usually the problem can be divided into three components: input, process
and output. Outputs are the goal of the problem solution. Inputs are the data you
use to solve the problem. Processes are the steps needed to convert input
information into the output results.




      www.ppk.kpm.my                                                      < 3 >
Learning Module: Programming




C).     Situation
Based on the information given, read the situation below and define the
problem, input, process and output.

 Situation
 Encik Malik is the manager of Enviro Car Enterprise. He asks you to develop a
 system to calculate the monthly instalment for every potential customer.




Encik Malik has made an appointment to see you at his office at 9.00 am on
Thursday morning
You         : Good morning, En. Malik.
En. Malik   : Good morning. Ahh.. You are punctual. I like that.
You         : Certainly. I appreciate doing business with you.
En. Malik   : Have a sit. Let us discuss the problems that I’m facing.
You         : Thank you.
En Malik    : Now, where should we start?
You         : Just tell me, what do you want me to do?
En. Malik   : When my customer decides to buy a car, I will get the customer’s
              details and fill it in a form. My problem is, I have to calculate the
              monthly instalment manually. It is very tiring as I always have to
              recalculate to make sure there is no mistake.
You         : I see. Do you face any other problem?
En. Malik   : Now the prices of cars have gone down and I foresee that the
              number of my customers is increasing. This phenomenon has
              increased my workload.
You         : I see. You mentioned that you have to calculate the monthly
              instalments. Is there any other information that you need to give to
              your customer?
En. Malik   : Usually I will give them the instalment details.The details include the
              monthly balance every month until they complete their payments.
You         : How do you determine a customers eligibility to get the loan?
En. Malik   : I will check their net income.
You         : What is the information you need to process the monthly
              instalment?
En. Malik   : I need to know the car model, car price, down payment, number
              of years for the loan, and its related annual interest percentage.




      www.ppk.kpm.my                                                          < 4 >
Learning Module: Programming




You         : How do you calculate the monthly instalment?
En. Malik   : The calculation for monthly instalment is quite complicated. I
              have written down the calculation on this paper. Can you
              understand it?



                                     AnnualInterestPercentage
                        (( Loan x(                          )) x Numberof Years) € Loan
 MonthlyInstalment •                          100
                                               Numberof Year x12

You         : Yes, thank you. I have another question, does your customer
              decide on the payment period?
En. Malik   : Yes. If the customer is a government servant, we will let them pay
              either 10, 7 or 5 years. Otherwise the payment period will be 7 or 5
              years only.
You         : Okay. there any other information that you need to tell me about
              your manual system?
En. Malik   : That’s all.
You         : Alright, I’ll discuss with my team members and will inform you then.
              Thank you.
En. Malik   : You’re welcome.




   www.ppk.kpm.my                                                                 < 5 >
Learning Module: Programming




WRITING ACTIVITY


II). Based on the situation, answer the following questions below.


1. Define the problem En. Malik faces in his company.




2. Identify the input En. Malik needs to collect everytime he meets a potential
   customer.




   www.ppk.kpm.my                                                           < 6 >
Learning Module: Programming




3. Identify the necessary output En. Malik sees in his manual system.




4. Write a formula on how to calculate the monthly instalment.




   www.ppk.kpm.my                                                       < 7 >
Learning Module: Programming


SUBTOPIC :                  5.2.2 Develop A Program


B.      Phase 2 - Program Design


LEARNING OUTCOMES
By using this module, you should be able to:
        1.    write pseudocode;
        2.    create flowchart; and
        3.    draw the user interface design


DURATION :            4 periods


I).     READING ACTIVITY


a).     Input Process Output (IPO) Chart


Before writing a pseudocode, it is always good to practice drawing an Input
Process Output (IPO) chart. The IPO chart is a tool for collecting input, process
and output. To use the IPO chart, you need to start with the output which is the
goal of the program. Then, list the inputs. Finally list the steps needed to convert
the input information into the output you want. Here is the IPO chart that shows
you the necessary input, process and output for En. Malik’s new program.


        Table 1 : Input, process and output for en Malik’s new program.

Input                             Processing                              Output

1. Customer’s name
2. Net income per month
3. Model of the car
                                  Loan = Price – Down Payment
4. Price of car
5. Down Payment                                                           Monthly
                                  Monthly Instalment = { [ ( Loan x (     Instalment
6. Annual Interest percentage     Annual Interest Percentage / 100 ) ]
                                  x Number of Years + Loan } /
                                  (Number of Years x 12 )




      www.ppk.kpm.my                                                         < 8 >
Learning Module: Programming


Input                            Processing                              Output
7. Number of Years
     - option for government
       servents ( 10,7,of 5
       years )
     or
     - option for private
       employes ( 7 or 5
       years)

b).     Pseudocode
Pseudocode is the English-like statements that follow a loosely defined syntax,
Pseudocode is used to convey the design of an algorithm. It shows an outline of
the logic of the program that programmers use to help them plan an algorithm. It
is like writing the step-by-step summary of the program. It also states the process
part of the IPO charts.
A pseudocode always start with the word PROGRAM followed by the program
name, and end the pseudocode with END PROGRAM. A sample of pseudocode
based on the given situation, is shown in Figure 1.

         PROGRAM Calculate_Instalment

         READ customer name

         READ net income

         CHECK the customer’s net income

             READ the car model

             READ the car price
                                                               Pseudocode
             READ down payment

             READ annual interest percentage

             READ the number of years for payment

             CALCULATE the monthly instalment

             PRINT the monthly instalment

      END PROGRAM



             Figure 1. Example of pseudocode.


      www.ppk.kpm.my                                                        < 9 >
Learning Module: Programming




c).       Flowchart


A flowchart is a step-by-step activity on how to solve a problem. It consists of a
special geometric symbols connected by arrows. Each symbol shows the
progression in which the steps take place. Flowchart should “flow” from the top of
the page to the bottom.
Read Table 2 for descriptions for each symbol.
      Table 2 : Basic Flow Chart Symbols , adapted from An Introduction to Programming
                                Using Visual Basic 6.0 (2004)

      Symbol          Name                             Description

                                 Used to represent the beginning (Start) or the end
                    Terminal
                                 (End) of a task.

                                 Used for input and output operations, such as
                    Input or
                                 reading and printing. The data to be read or printed
                    Output
                                 are described inside.

                                 Used for any logic or comparison operations. Unlike
                                 the input/output and processing symbols, which have
                                 one entry and one exit flow line, the decision symbol
                    Decision
                                 has one entry and two exit paths. The part chosen
                                 depends on whether the answer to a question is
                                 “yes” or “no”.

                                 Used for arithmetic and data-manipulation operation.
                    Process
                                 The instructions are listed inside the symbol.

                    Connector Used to join different flow lines.

                                 Used to represent symbols and indicate the flow of
                    Flow line
                                 logic




      www.ppk.kpm.my                                                            < 10 >
Learning Module: Programming


This sample flow chart is to assist you to develop a program. See Figure 2.



                                   Start


                                  Read
                             Customer Name,
                               Net Income



                              Net Income >=               No
                                  2000?


                                 Yes

                                  Read
                               Car Model,
                                Car Price,
                            Down Payment,
                       Annual Interest Percentage,
                           Number of Years


                                Calculate
                            Monthly Instalment



                                  Print
                            Monthly Instalment



                                    Stop

                            Figure 2: Sample Flowchart




   www.ppk.kpm.my                                                        < 11 >
Learning Module: Programming




II).     WRITING ACTIVITY


User Interface Design
User interface design is a simple layout of the screen you want to design for your
customer.


See the two examples in Figure 3 and 4 for input and output user interface
design.



                   Name




                   Figure 3 : User Inteface Design for Input




                          Thank you, your account is being processed…




                  Figure 4: User Inteface Design for Output




       www.ppk.kpm.my                                                     < 12 >
Learning Module: Programming




Draw your design user interface, based on the input and output you have
produced in Problem Analysis Stage (Page 6 and 7).




                      User Interface Design for Input




                     User Interface Design for Output




   www.ppk.kpm.my                                                         < 13 >
Learning Module: Programming




SUBTOPIC :                   5.2.2 Develop A Program


C.      Phase 3 - Coding

LEARNING OUTCOMES
By using this module, you should be able to:
        1.    create user interface for the new program;
        2.    set the properties for each object in your user interface;
        3.    write program code; and
        4.    save the program.


DURATION :           10 periods


1).     HANDS-ON ACTIVITY


a).     What is coding ?
Coding is the next step after the program logic is formulatedusing the
appropriate programming language. It also refers to entering the list of
commands that later becomes a computer program.


b).     Starting a project
In this activity you will start building Enviro program by creating a new project.
Then you will use controls in the toolbox to construct the user interface.




      www.ppk.kpm.my                                                          < 14 >
Learning Module: Programming




After clicking on the Visual Basic program, double click on Standard EXE button
as shown in Figure 5.




                           Figure 5: Standard EXE screen


After that you will see the screen shown in Figure 6.




   www.ppk.kpm.my                                                       < 15 >
Learning Module: Programming




                         Figure 6: The Visual Basic Interface


1. To start a new programming project, on the File menu, click the New Project
   command.


2. Click OK to create a standard 32-bit Visual Basic application.




   www.ppk.kpm.my                                                       < 16 >
Learning Module: Programming




3. The picture in Figure 7 shows the most useful tools in your Visual Basic
   program:
4.


           TextBox                                                 PictureBox


          CheckBox                                                    Label

           Option                                              CommandButton

           ListBox                                                 ComboBox

                                                                     Frame
           Image




            Figure 7: The most useful Visual Basic controls in the Toolbox.


c).     Adding command buttons
1. To add a command button object on the form, click the CommandButton
   control in the toolbox. Then drag the button and place it on the form.




      www.ppk.kpm.my                                                            < 17 >
Learning Module: Programming


2. You will see the screen which is shown in Figure 5, after you have added the
   CommandButton.




                         Figure 5: Your first command button


3. To change the settings for the command button, click the first command
   button (Command1) on the form.


4. Double-click it to open the Properties window title bar.


5. The Properties window is enlarged to full size, as shown in the illustration on
   Figure 6.




                       Figure 6: Command1 Properties window


6. The Properties window lists the settings for the first command button. These
   include settings for the background color, caption, font height and width of the
   command button.



   www.ppk.kpm.my                                                           < 18 >
Learning Module: Programming




7. Double-click the Caption property in the left column of the Properties window.


8. The current Caption setting ("Command1") is highlighted in the Properties
   window.


9. Type Your Instalment and press Enter.


10.The Caption property changes to " Your Instalment " in the Properties window
   and on the form.


11.Add another two new command buttons by repeating step 1.


12.Change their properties by repeating step 4 – 10, according to the table
   shown in Table 2.


          Table2: CommandButton2 and CommandButton3 Properties details

           Control Tool           Property                Object

                              Name              cmdReset
         CommandButton2       Caption           Reset
                              BackColor         &H80000000F&

                              Name              cmdExit
         CommandButton3       Caption           Exit
                              BackColor         &H80000000F&




   www.ppk.kpm.my                                                         < 19 >
Learning Module: Programming




13.When you have finished adding all the command buttons, you will see the
   result as shown in Figure 7.




                    Figure 7: Three finished command buttons




 You can delete an object by selecting the object on the form and then pressing
 the Delete key.




   www.ppk.kpm.my                                                       < 20 >
Learning Module: Programming




d).     Adding labels
A label is a special user interface control. It is designed to display text, numbers,
or symbols when a program runs.


1. Click the Label control in the toolbox, and then drag it onto the form, as
   shown in Figure 8.




                               Figure 8: Your first Label


2. Change the properties for the labels in the program. Click label1.


3. Click the Name property, and type lblTitle into the property.


4. Double-click the Caption property, and modify it into Enviro Car Enterprise.




      www.ppk.kpm.my                                                          < 21 >
Learning Module: Programming




5. Click the BackColor property and change it into &H00FFFF00&. See the
   result on Figure 9




                      Figure 9: The newly changed label title


6. You have finished with the first label. Now you need to change the Name,
   Caption and BackColor properties of the last nine labels. Create nine more
   labels, named Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9
   and Label10 on the form by repeating step 1.




   www.ppk.kpm.my                                                      < 22 >
Learning Module: Programming


7. Change the label properties by repeating step 2 – 5 (page 21 and 22), you
   need to change the properties according to the table shown in Table 3.


                     Table 3: Label2 – Label10 Properties details

        Control Tool            Property                      Object
                         Name                       lblName
            Label2       Caption                    Customer name
                         BackColor                  &H00FFFF00&
                         Name                       lblIncome
            Label3       Caption                    Monthly Net Income
                         BackColor                  &H00FFFF00&
                         Name                       lblModel
            Label4       Caption                    Car Model
                         BackColor                  &H00FFFF00&
                         Name                       lblPrice
            Label5       Caption                    Car Price
                         BackColor                  &H00FFFF00&
                         Name                       lblPayment
            Label6       Caption                    Down Payment
                         BackColor                  &H00FFFF00&
                         Name                       lblInterest
            Label7       Caption                    Annual Interest
                         BackColor                  &H00FFFF00&
                         Name                       lblGoverment
            Label8       Caption                    Government
                         BackColor                  &H00FFFF00&
                         Name                       lblPrivate
            Label9       Caption                    Private
                         BackColor                  &H00FFFF00&
                         Name                       lblDisplay
           Label10       Caption                    (leave it blank)
                         BackColor                  &H00FFFF00&


Tips


 You can change the BackColor properties for the nine labels in one step.
 1. Hold down the Shift key, and click al the 9 Labels
 2. You will see a set of selection rectangles appearing around each label that
    you click.
 3. When you have selected them all, release the Shift key.
 4. Double-click the BackColor property, and then type &H00FFFF00&.


8. When you have finished, your ten labels should look like those in the following
   illustration (Figure 10).


   www.ppk.kpm.my                                                         < 23 >
Learning Module: Programming




                                     Label1

                                     Label2

                                     Label3

                                     Label4

                                     Label5

                                     Label6

                                     Label7

                                     Label8

                                     Label9

                                     Label10




                 Figure 10: Finished labels




www.ppk.kpm.my                                            < 24 >
Learning Module: Programming




e).     Adding textbox


A textbox is a special user interface control designed to receive input from the
user as well as to display the output. It can handle text and numbers but not
images.


1. Click the TextBox control in the toolbox, and then drag it onto the form, like
   the one shown in Figure 11.




                                        Textbox1




                            Figure 11: Your first TextBox


2. Change the properties for the textbox in the program.


3. Click the Name property, and type txtName into the property.


4. Click the BackColor property and change it into &H80000005&.




      www.ppk.kpm.my                                                        < 25 >
Learning Module: Programming




5. You have finished with the first textbox. Now you need to change the Name
   and BackColor properties of the last four textboxes. Create four more
   textboxes, named TextBox2, TextBox3, TextBox4 and TextBox5 on the form
   by repeating step 1.


6. Change their properties by repeating step 3 and step 4( on page 23),
   according to the table shown in Table 4.


                  Table 4: TextBox2 – TextBox5 Properties Details

             Control Tool         Property               Object

                             Name                 txtModel
               TextBox2
                             BackColor            &H80000005&

                             Name                 txtPrice
               TextBox3
                             BackColor            &H80000005&

                             Name                 txtPayment
               TextBox4
                             BackColor            &H80000005&

                             Name                 txtInterest
               TextBox5
                             BackColor            &H80000005&




   www.ppk.kpm.my                                                         < 26 >
Learning Module: Programming




7. When you have finished, your five text boxes should look like those in the
   following illustration (Figure 12).




                                                 Textbox1

                                                 Textbox2

                                                 Textbox3

                                                 Textbox4

                                                 Textbox5




                           Figure 12: Finished textboxes




   www.ppk.kpm.my                                                         < 27 >
Learning Module: Programming




f).     Adding Combo Box


A Combo Box is a special user interface control designed to present a list of
items where the user can click and select the items from the list. However, the
user needs to click on the small arrowhead on the right of the combo box to see
the items which are presented in a drop-down list.


1. Click the ComboBox control in the toolbox, and then drag it onto the form,
   like the one shown in Figure 13.




                                         ComboBox1




                         Figure 13: Your first ComboBox


2. Change the properties for the combo box in the program.


3. Click the Name property, and type cboIncome into the property.


4. Click the BackColor property and change it into &H80000005&.




      www.ppk.kpm.my                                                   < 28 >
Learning Module: Programming




5. When you have finished, your combo box should look like the following
   illustration (Figure 14).




                         Figure 14: Finished Combo Box




   www.ppk.kpm.my                                                      < 29 >
Learning Module: Programming




g).     Adding Option Button


An Option button is a special user interface control designed to let the user
select it as one of the choices.


1. Click the Option control button in the toolbox, and then drag it onto the form,
   like the one shown in Figure 15.




                                           Option
                                           button




                            Figure 15: Your first Option


2. Change the properties for the option in the program.


3. Click the Name property, and type optG10 into the property.


4. Click the Caption property, and type 10years into the property.


5. Click the BackColor property and change it into &H00FFC0C0&.




      www.ppk.kpm.my                                                      < 30 >
Learning Module: Programming




6. You have finished with the first option button. Now you need to change the
   Name, Caption and BackColor properties of the last four options button.
   Create four more options button. Named them Option2, Option3, Option4 and
   Option5 on the form by repeating step 1.


7. Change their properties by repeating step 3 – 5, according to the table shown
   in Table 5.



                     Table 5: Option2 – Option5 Properties Details

      Control Tool                      Property                     Object

Option2                       Name                          optG7
                              Caption                       7years
                              BackColor                     &H00FFC0C0&

Option3                       Name                          optG5
                              Caption                       5years
                              BackColor                     &H00FFC0C0&

Option4                       Name                          optP7
                              Caption                       7years
                              BackColor                     &H00FFC0C0&

Option5                       Name                          optP5
                              Caption                       5years
                              BackColor                     &H00FFC0C0&




   www.ppk.kpm.my                                                             < 31 >
Learning Module: Programming




8. When you have finished, your options buttons should look like the following
   illustration (Figure 16).




                            Figure 16: Finished Options




       Option button




   www.ppk.kpm.my                                                        < 32 >
Learning Module: Programming




h).     Adding Frame


A Frame is a special user interface control designed to draw a border around
objects.


1. Click the Frame control in the toolbox, and then drag it onto the form, like the
   one shown in Figure 17.




                                         Frame1




                             Figure 17: Your first Frame


2. Change the properties for the frame in the program.


3. Click the Name property, and type fraEmploy into the property.


4. Click the Caption property, and type Employee of into the property.


5. Click the BackColor property and change it into &H00FFC0C0&.




      www.ppk.kpm.my                                                       < 33 >
Learning Module: Programming




6. When you have finished, your frame should look like the following illustration
   (Figure 18).




                             Figure 18: Finished Frame
      Frame


i).      Writing the code


Now you are ready to write the code for the Enviro program. Your objects
(command buttons and labels) are ready to receive input from the user and
process it automatically. However, you will need the codes that actually calculate
the installment payment and display it in a box.


The Code window is a special window in the programming environment that you
use to enter and edit Visual Basic program statements. Inside the Code window
are program statements that mark the beginning and the end of this particular
Visual Basic subroutine, it is also called event procedure, a block of code
associated with a particular object in the interface.




      www.ppk.kpm.my                                                       < 34 >
Learning Module: Programming




In the following steps, you will need to enter the program code for Enviro in the
Code window.


1. Double click the spaces on the form.


2. Type the details below between Private Sub Form_Load() and End Sub.

                         Private Sub Form_Load()
                               optG10.Value = False
         Type                  optG7.Value = False
         this                  optG5.Value = False
         part                  optP7.Value = False
                               optP5.Value = False
                         End Sub


3. Close this code window to return to your form.


4. Double-click the Exit command button on the form.


5. Type End, in between Private Sub cmdExit_Click(Index As Integer) and
   End Sub and press the Down arrow key.

            Type         Private Sub cmdExit_Click(Index As Integer)
            this           End
            part         End Sub


6. Close this code window to return to your form.


7. Repeat step 4 for Reset command button.




   www.ppk.kpm.my                                                        < 35 >
Learning Module: Programming




8. Type the details below between Private Sub cmdReset_Click(Index As
   Integer) and End Sub.

                         Private Sub cmdReset_Click(Index As Integer)
                           txtName.Text = ""
                           cboIncome.ListIndex = -1
                           txtModel.Text = ""
         Type
                           txtPrice.Text = ""
         this
                           txtInterest.Text = ""
         part
                           txtPayment.Text = ""
                           lblDisplay.Caption = ""
                           txtName.SetFocus
                         End Sub


9. Close this code window to return to your form.


10.Repeat step 4 for Your Installment command button.




   www.ppk.kpm.my                                                   < 36 >
Learning Module: Programming




11.Type the details below between Private Sub cmdInstalment_Click() and
   End Sub.
               Private Sub cmdInstalment_Click()
                 Dim Loan As Currency
                 Dim Price As Currency
                 Dim Interest As Single
                 Dim Instalment As Currency
                 Dim Payment As Currency

                 Price = Val(txtPrice.Text)
                 Interest = Val(txtInterest.Text)
                 Payment = Val(txtPayment.Text)

               If txtName.Text = "" Then MsgBox "Plese enter customer name", vbCritical, "Name"
                     If cboIncome.ListIndex < 1 Then
                     lblDisplay.Caption = "Sorry, your income is not elligible to apply a loan"
                   Else
                     If optG10.Value Then
                         Year = 10

                   Loan = Price - Payment
 Type              Instalment = (((Loan * (Interest / 100)) * Year + Loan) / (Year * 12))
 this              lblDisplay.Caption = "RM" & Format(Instalment, "#####0.00")
 part              ElseIf optG7.Value Or optP7.Value Then
                      Year = 7
                   Loan = Price - Payment
                   Instalment = (((Loan * (Interest / 100)) * Year + Loan) / (Year * 12))
                   lblDisplay.Caption = "RM" & Format(Instalment, "#####0.00")


                   ElseIf optG5.Value Or optP5.Value Then
                      Year = 5
                   Loan = Price - Payment
                   Instalment = (((Loan * (Interest / 100)) * Year + Loan) / (Year * 12))
                   lblDisplay.Caption = "RM" & Format(Instalment, "#####0.00")

                   Else
                   MsgBox "Please choose your period of year", vbCritical, "Number of year"

                 End If
                 End If
               End Sub



12.Close this code window to return to your form.




   www.ppk.kpm.my                                                                           < 37 >
Learning Module: Programming




j).     Saving the Program


Now that you have completed the Enviro program, you should save it to a disk.
To save a program in Visual Basic, click Save Project As on the File menu or
click the Save Project button on the toolbar.


1. On the File menu, click the Save Project As command. (You can save your
   program at any time during the programming process.)


2. The Save File As dialog box appears, prompting you for the name and
   storage location for your form.


3. Type Enviro in the File Name text box, and press Enter.


4. The form is saved under the name Enviro.frm. The Save Project As dialog
   box then appears in Figure 19.

                             My Document

                  Enviro




                           Enviro




                      Figure 19: The Save Project As dialog box


5. Type Enviro and press Enter.


6. The Enviro project is saved under the name Enviro.vbp.




      www.ppk.kpm.my                                                     < 38 >
Learning Module: Programming




SUBTOPIC :                      5.2.2 Develop A Program


D.       Phase 4 – Testing and Debugging

LEARNING OUTCOMES
By using this module, you should be able to:
         1.           test the program;
         2.           debug problems; and
         3.           compile the program.


DURATION :               4 periods


a).      Test the program


1. To test a Visual Basic program from the programming environment, you can
   choose either one of the followings:
      (a) click Start on the Run menu;
      (b) click the Start button on the toolbar; and
      (c) press F5.


      When you test it and your program does not contain any errors, then you have
      successfully produced a good Enviro program. It should produce the correct
      and accurate result to solve the company problem.


b).      Debug the program


1. If the program you tested just now cannot run properly, meaning your program
   has a few errors. The action of removing these errors is called debugging.




      www.ppk.kpm.my                                                        < 39 >
Learning Module: Programming




2. If Visual Basic displays an error message like the picture shown below, you
   may still have a typing mistake or two in your program code. See Figure 20.




                        Figure 20: The error message displayed
                               while running a program


3. Try to debug (correct the errors) by comparing the printed version in this
   module (Page 15 - 38) with the one you typed in Visual Basic.
4. You should test the program several time until it can run smoothly.


5. You should also check on the result you test on the screen whether it is the
   one you wanted. If not, check again on Page 15 - 38.


6. If the problems still arise, you should consult your friends or teacher.


c).     Compile the program


1. In Visual Basic, compiling a program means to make an executable file. This
   executable file should be free of errors and can run successfully.


2. On the File menu, click the Make Enviro.exe command. (Visual Basic adds
   your program’s name to the command automatically when you have saved a
   previous copy.)




      www.ppk.kpm.my                                                          < 40 >
Learning Module: Programming




3. The Make Project dialog box appears, as in Figure 21.

                             My Document

                  Enviro




                           Enviro




                       Figure 21: The Make Project dialog box


4. The executable Enviro file is saved under the name Enviro.exe.


5. You can save this Enviro.exe program in a mobile disk and run it on any
   computers. To run this program, the computer does not have to install a
   Visual Basic program.




   www.ppk.kpm.my                                                       < 41 >
Learning Module: Programming


SUBTOPIC :                     5.2.2 Develop A Program


E.         Phase 5 - Documentation

LEARNING OUTCOMES
By using this module, you should be able to
           1.    create internal documentation; and
           2.    gather all the documents from all the phases into a folio for external
                 documentation.


Student previous knowledge
       €    Student should able to do print screen


DURATION :              2 periods


I).        READING ACTIVITY


a).        Internal Documentation
Internal documentation is the comment created within the program by the
programmer. Internal documentation is used to provide information about the
program. Generally, this type of documentation is called a comment, and
explains the purpose of a particular line of code or why the programmer used a
particular procedure. An example of internal documentation is shown below:




                                                                  Note     that    the
                                                                  comments use a
                                                                  single     quotation
                                                                  mark (') ahead of
                                                                  them, and that they
                                                                  appear in green.




Internal documentation is important because it provides information to
programmers who may not be familiar with a particular program.




      www.ppk.kpm.my                                                           < 42 >
Learning Module: Programming




b).      External Documentation
                             External documentation is usually a printed manual about
                             the program, how it works, how to install it, or how to use
                             it    (user    documentation).       Sometimes     external
                             documentation is provided as a word processing
                             document on the program disk, or as a manual for a user
                             to read. A readme file is a type of external documentation.
                             User guides and installation manuals are also types of
                             printed external documentation.


                             In this module, you will need to create both internal and
                             external documentations for your program as you work
                             through the project.


II).     WRITING ACTIVITY


1. Type a few comments (internal documentation) in your coding and submit all
   the related Visual Basic files in a diskette to your teacher.


2. Type the minimum requirements for your customer to install in your program.
   You may add more specifications in the table so that your customer can run
   your program smoothly.

No.                   Specifications                   Minimum Requirements

1.      Processor type
        (e.g. Intel Pentium 3)

2.      Hard Disk capacity
        (e.g. 10GB)

3       Size of RAM
        (e.g. 128MB)

4       Screen Resolutions
        (e.g. 800x600 pixels)

5       Type of Operating Systems
        (e.g. Window 98)




       www.ppk.kpm.my                                                           < 43 >
Learning Module: Programming



3. You are going to write a simple user guide here. Write the steps on teaching
   your customer to install the program into his computer.




                           CONGRATULATIONS !!
YOU HAVE SUCCESSFULLY COMPLETED THIS MODULE. YOU ARE NOW
ABLE TO APPLY THE NECESSARY PROGRAMMING SKILL.




   www.ppk.kpm.my                                                      < 44 >

Contenu connexe

En vedette

Fund. cableado v&d capitulo 02.2
Fund. cableado v&d   capitulo 02.2Fund. cableado v&d   capitulo 02.2
Fund. cableado v&d capitulo 02.2Jair BG
 
联盟行销的5大好处
联盟行销的5大好处联盟行销的5大好处
联盟行销的5大好处ecchina888
 
Fund. cableado v&d capitulo 03.2
Fund. cableado v&d   capitulo 03.2Fund. cableado v&d   capitulo 03.2
Fund. cableado v&d capitulo 03.2Jair BG
 
Fund. cableado v&d capitulo 02.1
Fund. cableado v&d   capitulo 02.1Fund. cableado v&d   capitulo 02.1
Fund. cableado v&d capitulo 02.1Jair BG
 

En vedette (8)

Fund. cableado v&d capitulo 02.2
Fund. cableado v&d   capitulo 02.2Fund. cableado v&d   capitulo 02.2
Fund. cableado v&d capitulo 02.2
 
annual-full
annual-fullannual-full
annual-full
 
Diploma Certificate
Diploma CertificateDiploma Certificate
Diploma Certificate
 
联盟行销的5大好处
联盟行销的5大好处联盟行销的5大好处
联盟行销的5大好处
 
2
22
2
 
Kleding bedrijfskleding bedrukken Venray
Kleding bedrijfskleding bedrukken VenrayKleding bedrijfskleding bedrukken Venray
Kleding bedrijfskleding bedrukken Venray
 
Fund. cableado v&d capitulo 03.2
Fund. cableado v&d   capitulo 03.2Fund. cableado v&d   capitulo 03.2
Fund. cableado v&d capitulo 03.2
 
Fund. cableado v&d capitulo 02.1
Fund. cableado v&d   capitulo 02.1Fund. cableado v&d   capitulo 02.1
Fund. cableado v&d capitulo 02.1
 

Similaire à La5 programming

Learning area 5 programming
Learning area 5   programmingLearning area 5   programming
Learning area 5 programmingShuren Lew
 
Mb0049 project management (2)
Mb0049   project management (2)Mb0049   project management (2)
Mb0049 project management (2)smumbahelp
 
Discrete Event Simulation, CASE tool built using C#
Discrete Event Simulation, CASE tool built using C#Discrete Event Simulation, CASE tool built using C#
Discrete Event Simulation, CASE tool built using C#Ron Perlmuter
 
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
Week 2PRG 218   Variables and Input and Output OperationsYou w.docxWeek 2PRG 218   Variables and Input and Output OperationsYou w.docx
Week 2PRG 218 Variables and Input and Output OperationsYou w.docxmelbruce90096
 
Mb0049 project management (2)
Mb0049   project management (2)Mb0049   project management (2)
Mb0049 project management (2)Study Stuff
 
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7helpido9
 
System Analysis & Design Report on Summer Training System
System Analysis & Design Report on Summer Training SystemSystem Analysis & Design Report on Summer Training System
System Analysis & Design Report on Summer Training Systemthededar
 
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7comp274
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptxshoaibkhan716300
 
Mi0033 software engineering
Mi0033   software engineeringMi0033   software engineering
Mi0033 software engineeringsmumbahelp
 
Industrail training report on website design and development
Industrail training report on website design and developmentIndustrail training report on website design and development
Industrail training report on website design and developmentMUSICbegins
 
Latest proposal project info zakat
Latest proposal project info zakatLatest proposal project info zakat
Latest proposal project info zakatUmmi Zakiah
 
zaid ppt.pptx
zaid ppt.pptxzaid ppt.pptx
zaid ppt.pptxaasim40
 
Cis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interfaceCis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interfacesdjdskjd9097
 

Similaire à La5 programming (20)

Learning area 5 programming
Learning area 5   programmingLearning area 5   programming
Learning area 5 programming
 
Mb0049 project management (2)
Mb0049   project management (2)Mb0049   project management (2)
Mb0049 project management (2)
 
Discrete Event Simulation, CASE tool built using C#
Discrete Event Simulation, CASE tool built using C#Discrete Event Simulation, CASE tool built using C#
Discrete Event Simulation, CASE tool built using C#
 
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
Week 2PRG 218   Variables and Input and Output OperationsYou w.docxWeek 2PRG 218   Variables and Input and Output OperationsYou w.docx
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
 
Mb0049 project management (2)
Mb0049   project management (2)Mb0049   project management (2)
Mb0049 project management (2)
 
Software company
Software companySoftware company
Software company
 
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7
 
System Analysis & Design Report on Summer Training System
System Analysis & Design Report on Summer Training SystemSystem Analysis & Design Report on Summer Training System
System Analysis & Design Report on Summer Training System
 
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7
 
Financial Magt
Financial MagtFinancial Magt
Financial Magt
 
Mini Project- Torque Control of a DC Motor
Mini Project- Torque Control of a DC MotorMini Project- Torque Control of a DC Motor
Mini Project- Torque Control of a DC Motor
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptx
 
MPP-UPNVJ
MPP-UPNVJMPP-UPNVJ
MPP-UPNVJ
 
Mi0033 software engineering
Mi0033   software engineeringMi0033   software engineering
Mi0033 software engineering
 
ABHISHEK RESUME
ABHISHEK RESUMEABHISHEK RESUME
ABHISHEK RESUME
 
Industrail training report on website design and development
Industrail training report on website design and developmentIndustrail training report on website design and development
Industrail training report on website design and development
 
Latest proposal project info zakat
Latest proposal project info zakatLatest proposal project info zakat
Latest proposal project info zakat
 
zaid ppt.pptx
zaid ppt.pptxzaid ppt.pptx
zaid ppt.pptx
 
Technical Debt
Technical DebtTechnical Debt
Technical Debt
 
Cis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interfaceCis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interface
 

Plus de Azmiah Mahmud (20)

Buku Panduan-HEM-2016
Buku Panduan-HEM-2016Buku Panduan-HEM-2016
Buku Panduan-HEM-2016
 
Notacd01
Notacd01Notacd01
Notacd01
 
Notacd05
Notacd05Notacd05
Notacd05
 
Notacd04
Notacd04Notacd04
Notacd04
 
Notacd03
Notacd03Notacd03
Notacd03
 
Notacd02
Notacd02Notacd02
Notacd02
 
La3 ict-topic-3-computer-networks
La3 ict-topic-3-computer-networksLa3 ict-topic-3-computer-networks
La3 ict-topic-3-computer-networks
 
La2 ict-topic-2-computer-systems
La2 ict-topic-2-computer-systemsLa2 ict-topic-2-computer-systems
La2 ict-topic-2-computer-systems
 
La1 ict-topic-1-ict-and-society
La1 ict-topic-1-ict-and-societyLa1 ict-topic-1-ict-and-society
La1 ict-topic-1-ict-and-society
 
Bab 2 sistem komputer
Bab 2 sistem komputerBab 2 sistem komputer
Bab 2 sistem komputer
 
Notacd01
Notacd01Notacd01
Notacd01
 
Notacd12
Notacd12Notacd12
Notacd12
 
Notacd11
Notacd11Notacd11
Notacd11
 
Notacd10
Notacd10Notacd10
Notacd10
 
Notacd09
Notacd09Notacd09
Notacd09
 
Notacd08
Notacd08Notacd08
Notacd08
 
Nota programming
Nota programmingNota programming
Nota programming
 
Nota program development
Nota program developmentNota program development
Nota program development
 
Nota multimedia
Nota multimediaNota multimedia
Nota multimedia
 
Nota multimedia production team
Nota multimedia production teamNota multimedia production team
Nota multimedia production team
 

Dernier

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Dernier (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

La5 programming

  • 1.
  • 2. Learning Module: Programming 1. What is it? This is a learning module for a specific Learning Outcome as stipulated in the HSP that is : € 5.2 Program Development 2. Who is it for? This module is for students who are taking the ICT subject as their elective and for those who are interested in ICT. 3. What can be achieved? Upon completion of this module, you should be able to : € Apply program development phases to solve problems 4. Is previous knowledge necessary? No. The content of this module will enable you to acquire the knowledge. www.ppk.kpm.my < 1 >
  • 3. Learning Module: Programming TOPIC : 5.2 Program Development SUBTOPIC: 5.2.2 Develop A Program LEARNING OUTCOMES You should be able to: 5.2.2.1 apply program development phases to solve problems: A. Phase 1 - Problem Analysis B. Phase 2 - Program Design C. Phase 3 - Coding D. Phase 4 - Testing and Debugging E. Phase 5 - Documentation DURATION : 24 periods REFERENCES : 1. Schneider, D.I. (2004). An Introduction to Programming Using Visual Basic 6.0. Prentice Hall. New Jersey. 2. Behrouz A. Forouzan (2001). Computer Science, A Structured Programming Approach Using C, Brooks / Cole. California. 3. Timothy & Linda O’leary, (2007). Computing Essentials 2007, McGraw Hill, New York. 4. Garry B. Shelly (2007). Discovering Computers 2007. Thomson Course Technology, Massachusetts. www.ppk.kpm.my < 2 >
  • 4. Learning Module: Programming SUBTOPIC: 5.2.2 Develop A Program A. Phase 1 - Problem Analysis LEARNING OUTCOMES By using this module, you should be able to: 1. identify the problem; and 2. identify the input, processing and output. DURATION : 4 periods I). READING ACTIVITY a). What is problem analysis? We solve all kinds of problems in our daily life. A problem may involve how to commute to school, work or which homework to do first. Programming is the same. You need to make a clear statement of the problem you are trying to solve. b). What should you do in this process? To define a problem is the most difficult and important part of a programming project. Usually the problem can be divided into three components: input, process and output. Outputs are the goal of the problem solution. Inputs are the data you use to solve the problem. Processes are the steps needed to convert input information into the output results. www.ppk.kpm.my < 3 >
  • 5. Learning Module: Programming C). Situation Based on the information given, read the situation below and define the problem, input, process and output. Situation Encik Malik is the manager of Enviro Car Enterprise. He asks you to develop a system to calculate the monthly instalment for every potential customer. Encik Malik has made an appointment to see you at his office at 9.00 am on Thursday morning You : Good morning, En. Malik. En. Malik : Good morning. Ahh.. You are punctual. I like that. You : Certainly. I appreciate doing business with you. En. Malik : Have a sit. Let us discuss the problems that I’m facing. You : Thank you. En Malik : Now, where should we start? You : Just tell me, what do you want me to do? En. Malik : When my customer decides to buy a car, I will get the customer’s details and fill it in a form. My problem is, I have to calculate the monthly instalment manually. It is very tiring as I always have to recalculate to make sure there is no mistake. You : I see. Do you face any other problem? En. Malik : Now the prices of cars have gone down and I foresee that the number of my customers is increasing. This phenomenon has increased my workload. You : I see. You mentioned that you have to calculate the monthly instalments. Is there any other information that you need to give to your customer? En. Malik : Usually I will give them the instalment details.The details include the monthly balance every month until they complete their payments. You : How do you determine a customers eligibility to get the loan? En. Malik : I will check their net income. You : What is the information you need to process the monthly instalment? En. Malik : I need to know the car model, car price, down payment, number of years for the loan, and its related annual interest percentage. www.ppk.kpm.my < 4 >
  • 6. Learning Module: Programming You : How do you calculate the monthly instalment? En. Malik : The calculation for monthly instalment is quite complicated. I have written down the calculation on this paper. Can you understand it? AnnualInterestPercentage (( Loan x( )) x Numberof Years) € Loan MonthlyInstalment • 100 Numberof Year x12 You : Yes, thank you. I have another question, does your customer decide on the payment period? En. Malik : Yes. If the customer is a government servant, we will let them pay either 10, 7 or 5 years. Otherwise the payment period will be 7 or 5 years only. You : Okay. there any other information that you need to tell me about your manual system? En. Malik : That’s all. You : Alright, I’ll discuss with my team members and will inform you then. Thank you. En. Malik : You’re welcome. www.ppk.kpm.my < 5 >
  • 7. Learning Module: Programming WRITING ACTIVITY II). Based on the situation, answer the following questions below. 1. Define the problem En. Malik faces in his company. 2. Identify the input En. Malik needs to collect everytime he meets a potential customer. www.ppk.kpm.my < 6 >
  • 8. Learning Module: Programming 3. Identify the necessary output En. Malik sees in his manual system. 4. Write a formula on how to calculate the monthly instalment. www.ppk.kpm.my < 7 >
  • 9. Learning Module: Programming SUBTOPIC : 5.2.2 Develop A Program B. Phase 2 - Program Design LEARNING OUTCOMES By using this module, you should be able to: 1. write pseudocode; 2. create flowchart; and 3. draw the user interface design DURATION : 4 periods I). READING ACTIVITY a). Input Process Output (IPO) Chart Before writing a pseudocode, it is always good to practice drawing an Input Process Output (IPO) chart. The IPO chart is a tool for collecting input, process and output. To use the IPO chart, you need to start with the output which is the goal of the program. Then, list the inputs. Finally list the steps needed to convert the input information into the output you want. Here is the IPO chart that shows you the necessary input, process and output for En. Malik’s new program. Table 1 : Input, process and output for en Malik’s new program. Input Processing Output 1. Customer’s name 2. Net income per month 3. Model of the car Loan = Price – Down Payment 4. Price of car 5. Down Payment Monthly Monthly Instalment = { [ ( Loan x ( Instalment 6. Annual Interest percentage Annual Interest Percentage / 100 ) ] x Number of Years + Loan } / (Number of Years x 12 ) www.ppk.kpm.my < 8 >
  • 10. Learning Module: Programming Input Processing Output 7. Number of Years - option for government servents ( 10,7,of 5 years ) or - option for private employes ( 7 or 5 years) b). Pseudocode Pseudocode is the English-like statements that follow a loosely defined syntax, Pseudocode is used to convey the design of an algorithm. It shows an outline of the logic of the program that programmers use to help them plan an algorithm. It is like writing the step-by-step summary of the program. It also states the process part of the IPO charts. A pseudocode always start with the word PROGRAM followed by the program name, and end the pseudocode with END PROGRAM. A sample of pseudocode based on the given situation, is shown in Figure 1. PROGRAM Calculate_Instalment READ customer name READ net income CHECK the customer’s net income READ the car model READ the car price Pseudocode READ down payment READ annual interest percentage READ the number of years for payment CALCULATE the monthly instalment PRINT the monthly instalment END PROGRAM Figure 1. Example of pseudocode. www.ppk.kpm.my < 9 >
  • 11. Learning Module: Programming c). Flowchart A flowchart is a step-by-step activity on how to solve a problem. It consists of a special geometric symbols connected by arrows. Each symbol shows the progression in which the steps take place. Flowchart should “flow” from the top of the page to the bottom. Read Table 2 for descriptions for each symbol. Table 2 : Basic Flow Chart Symbols , adapted from An Introduction to Programming Using Visual Basic 6.0 (2004) Symbol Name Description Used to represent the beginning (Start) or the end Terminal (End) of a task. Used for input and output operations, such as Input or reading and printing. The data to be read or printed Output are described inside. Used for any logic or comparison operations. Unlike the input/output and processing symbols, which have one entry and one exit flow line, the decision symbol Decision has one entry and two exit paths. The part chosen depends on whether the answer to a question is “yes” or “no”. Used for arithmetic and data-manipulation operation. Process The instructions are listed inside the symbol. Connector Used to join different flow lines. Used to represent symbols and indicate the flow of Flow line logic www.ppk.kpm.my < 10 >
  • 12. Learning Module: Programming This sample flow chart is to assist you to develop a program. See Figure 2. Start Read Customer Name, Net Income Net Income >= No 2000? Yes Read Car Model, Car Price, Down Payment, Annual Interest Percentage, Number of Years Calculate Monthly Instalment Print Monthly Instalment Stop Figure 2: Sample Flowchart www.ppk.kpm.my < 11 >
  • 13. Learning Module: Programming II). WRITING ACTIVITY User Interface Design User interface design is a simple layout of the screen you want to design for your customer. See the two examples in Figure 3 and 4 for input and output user interface design. Name Figure 3 : User Inteface Design for Input Thank you, your account is being processed… Figure 4: User Inteface Design for Output www.ppk.kpm.my < 12 >
  • 14. Learning Module: Programming Draw your design user interface, based on the input and output you have produced in Problem Analysis Stage (Page 6 and 7). User Interface Design for Input User Interface Design for Output www.ppk.kpm.my < 13 >
  • 15. Learning Module: Programming SUBTOPIC : 5.2.2 Develop A Program C. Phase 3 - Coding LEARNING OUTCOMES By using this module, you should be able to: 1. create user interface for the new program; 2. set the properties for each object in your user interface; 3. write program code; and 4. save the program. DURATION : 10 periods 1). HANDS-ON ACTIVITY a). What is coding ? Coding is the next step after the program logic is formulatedusing the appropriate programming language. It also refers to entering the list of commands that later becomes a computer program. b). Starting a project In this activity you will start building Enviro program by creating a new project. Then you will use controls in the toolbox to construct the user interface. www.ppk.kpm.my < 14 >
  • 16. Learning Module: Programming After clicking on the Visual Basic program, double click on Standard EXE button as shown in Figure 5. Figure 5: Standard EXE screen After that you will see the screen shown in Figure 6. www.ppk.kpm.my < 15 >
  • 17. Learning Module: Programming Figure 6: The Visual Basic Interface 1. To start a new programming project, on the File menu, click the New Project command. 2. Click OK to create a standard 32-bit Visual Basic application. www.ppk.kpm.my < 16 >
  • 18. Learning Module: Programming 3. The picture in Figure 7 shows the most useful tools in your Visual Basic program: 4. TextBox PictureBox CheckBox Label Option CommandButton ListBox ComboBox Frame Image Figure 7: The most useful Visual Basic controls in the Toolbox. c). Adding command buttons 1. To add a command button object on the form, click the CommandButton control in the toolbox. Then drag the button and place it on the form. www.ppk.kpm.my < 17 >
  • 19. Learning Module: Programming 2. You will see the screen which is shown in Figure 5, after you have added the CommandButton. Figure 5: Your first command button 3. To change the settings for the command button, click the first command button (Command1) on the form. 4. Double-click it to open the Properties window title bar. 5. The Properties window is enlarged to full size, as shown in the illustration on Figure 6. Figure 6: Command1 Properties window 6. The Properties window lists the settings for the first command button. These include settings for the background color, caption, font height and width of the command button. www.ppk.kpm.my < 18 >
  • 20. Learning Module: Programming 7. Double-click the Caption property in the left column of the Properties window. 8. The current Caption setting ("Command1") is highlighted in the Properties window. 9. Type Your Instalment and press Enter. 10.The Caption property changes to " Your Instalment " in the Properties window and on the form. 11.Add another two new command buttons by repeating step 1. 12.Change their properties by repeating step 4 – 10, according to the table shown in Table 2. Table2: CommandButton2 and CommandButton3 Properties details Control Tool Property Object Name cmdReset CommandButton2 Caption Reset BackColor &H80000000F& Name cmdExit CommandButton3 Caption Exit BackColor &H80000000F& www.ppk.kpm.my < 19 >
  • 21. Learning Module: Programming 13.When you have finished adding all the command buttons, you will see the result as shown in Figure 7. Figure 7: Three finished command buttons You can delete an object by selecting the object on the form and then pressing the Delete key. www.ppk.kpm.my < 20 >
  • 22. Learning Module: Programming d). Adding labels A label is a special user interface control. It is designed to display text, numbers, or symbols when a program runs. 1. Click the Label control in the toolbox, and then drag it onto the form, as shown in Figure 8. Figure 8: Your first Label 2. Change the properties for the labels in the program. Click label1. 3. Click the Name property, and type lblTitle into the property. 4. Double-click the Caption property, and modify it into Enviro Car Enterprise. www.ppk.kpm.my < 21 >
  • 23. Learning Module: Programming 5. Click the BackColor property and change it into &H00FFFF00&. See the result on Figure 9 Figure 9: The newly changed label title 6. You have finished with the first label. Now you need to change the Name, Caption and BackColor properties of the last nine labels. Create nine more labels, named Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9 and Label10 on the form by repeating step 1. www.ppk.kpm.my < 22 >
  • 24. Learning Module: Programming 7. Change the label properties by repeating step 2 – 5 (page 21 and 22), you need to change the properties according to the table shown in Table 3. Table 3: Label2 – Label10 Properties details Control Tool Property Object Name lblName Label2 Caption Customer name BackColor &H00FFFF00& Name lblIncome Label3 Caption Monthly Net Income BackColor &H00FFFF00& Name lblModel Label4 Caption Car Model BackColor &H00FFFF00& Name lblPrice Label5 Caption Car Price BackColor &H00FFFF00& Name lblPayment Label6 Caption Down Payment BackColor &H00FFFF00& Name lblInterest Label7 Caption Annual Interest BackColor &H00FFFF00& Name lblGoverment Label8 Caption Government BackColor &H00FFFF00& Name lblPrivate Label9 Caption Private BackColor &H00FFFF00& Name lblDisplay Label10 Caption (leave it blank) BackColor &H00FFFF00& Tips You can change the BackColor properties for the nine labels in one step. 1. Hold down the Shift key, and click al the 9 Labels 2. You will see a set of selection rectangles appearing around each label that you click. 3. When you have selected them all, release the Shift key. 4. Double-click the BackColor property, and then type &H00FFFF00&. 8. When you have finished, your ten labels should look like those in the following illustration (Figure 10). www.ppk.kpm.my < 23 >
  • 25. Learning Module: Programming Label1 Label2 Label3 Label4 Label5 Label6 Label7 Label8 Label9 Label10 Figure 10: Finished labels www.ppk.kpm.my < 24 >
  • 26. Learning Module: Programming e). Adding textbox A textbox is a special user interface control designed to receive input from the user as well as to display the output. It can handle text and numbers but not images. 1. Click the TextBox control in the toolbox, and then drag it onto the form, like the one shown in Figure 11. Textbox1 Figure 11: Your first TextBox 2. Change the properties for the textbox in the program. 3. Click the Name property, and type txtName into the property. 4. Click the BackColor property and change it into &H80000005&. www.ppk.kpm.my < 25 >
  • 27. Learning Module: Programming 5. You have finished with the first textbox. Now you need to change the Name and BackColor properties of the last four textboxes. Create four more textboxes, named TextBox2, TextBox3, TextBox4 and TextBox5 on the form by repeating step 1. 6. Change their properties by repeating step 3 and step 4( on page 23), according to the table shown in Table 4. Table 4: TextBox2 – TextBox5 Properties Details Control Tool Property Object Name txtModel TextBox2 BackColor &H80000005& Name txtPrice TextBox3 BackColor &H80000005& Name txtPayment TextBox4 BackColor &H80000005& Name txtInterest TextBox5 BackColor &H80000005& www.ppk.kpm.my < 26 >
  • 28. Learning Module: Programming 7. When you have finished, your five text boxes should look like those in the following illustration (Figure 12). Textbox1 Textbox2 Textbox3 Textbox4 Textbox5 Figure 12: Finished textboxes www.ppk.kpm.my < 27 >
  • 29. Learning Module: Programming f). Adding Combo Box A Combo Box is a special user interface control designed to present a list of items where the user can click and select the items from the list. However, the user needs to click on the small arrowhead on the right of the combo box to see the items which are presented in a drop-down list. 1. Click the ComboBox control in the toolbox, and then drag it onto the form, like the one shown in Figure 13. ComboBox1 Figure 13: Your first ComboBox 2. Change the properties for the combo box in the program. 3. Click the Name property, and type cboIncome into the property. 4. Click the BackColor property and change it into &H80000005&. www.ppk.kpm.my < 28 >
  • 30. Learning Module: Programming 5. When you have finished, your combo box should look like the following illustration (Figure 14). Figure 14: Finished Combo Box www.ppk.kpm.my < 29 >
  • 31. Learning Module: Programming g). Adding Option Button An Option button is a special user interface control designed to let the user select it as one of the choices. 1. Click the Option control button in the toolbox, and then drag it onto the form, like the one shown in Figure 15. Option button Figure 15: Your first Option 2. Change the properties for the option in the program. 3. Click the Name property, and type optG10 into the property. 4. Click the Caption property, and type 10years into the property. 5. Click the BackColor property and change it into &H00FFC0C0&. www.ppk.kpm.my < 30 >
  • 32. Learning Module: Programming 6. You have finished with the first option button. Now you need to change the Name, Caption and BackColor properties of the last four options button. Create four more options button. Named them Option2, Option3, Option4 and Option5 on the form by repeating step 1. 7. Change their properties by repeating step 3 – 5, according to the table shown in Table 5. Table 5: Option2 – Option5 Properties Details Control Tool Property Object Option2 Name optG7 Caption 7years BackColor &H00FFC0C0& Option3 Name optG5 Caption 5years BackColor &H00FFC0C0& Option4 Name optP7 Caption 7years BackColor &H00FFC0C0& Option5 Name optP5 Caption 5years BackColor &H00FFC0C0& www.ppk.kpm.my < 31 >
  • 33. Learning Module: Programming 8. When you have finished, your options buttons should look like the following illustration (Figure 16). Figure 16: Finished Options Option button www.ppk.kpm.my < 32 >
  • 34. Learning Module: Programming h). Adding Frame A Frame is a special user interface control designed to draw a border around objects. 1. Click the Frame control in the toolbox, and then drag it onto the form, like the one shown in Figure 17. Frame1 Figure 17: Your first Frame 2. Change the properties for the frame in the program. 3. Click the Name property, and type fraEmploy into the property. 4. Click the Caption property, and type Employee of into the property. 5. Click the BackColor property and change it into &H00FFC0C0&. www.ppk.kpm.my < 33 >
  • 35. Learning Module: Programming 6. When you have finished, your frame should look like the following illustration (Figure 18). Figure 18: Finished Frame Frame i). Writing the code Now you are ready to write the code for the Enviro program. Your objects (command buttons and labels) are ready to receive input from the user and process it automatically. However, you will need the codes that actually calculate the installment payment and display it in a box. The Code window is a special window in the programming environment that you use to enter and edit Visual Basic program statements. Inside the Code window are program statements that mark the beginning and the end of this particular Visual Basic subroutine, it is also called event procedure, a block of code associated with a particular object in the interface. www.ppk.kpm.my < 34 >
  • 36. Learning Module: Programming In the following steps, you will need to enter the program code for Enviro in the Code window. 1. Double click the spaces on the form. 2. Type the details below between Private Sub Form_Load() and End Sub. Private Sub Form_Load() optG10.Value = False Type optG7.Value = False this optG5.Value = False part optP7.Value = False optP5.Value = False End Sub 3. Close this code window to return to your form. 4. Double-click the Exit command button on the form. 5. Type End, in between Private Sub cmdExit_Click(Index As Integer) and End Sub and press the Down arrow key. Type Private Sub cmdExit_Click(Index As Integer) this End part End Sub 6. Close this code window to return to your form. 7. Repeat step 4 for Reset command button. www.ppk.kpm.my < 35 >
  • 37. Learning Module: Programming 8. Type the details below between Private Sub cmdReset_Click(Index As Integer) and End Sub. Private Sub cmdReset_Click(Index As Integer) txtName.Text = "" cboIncome.ListIndex = -1 txtModel.Text = "" Type txtPrice.Text = "" this txtInterest.Text = "" part txtPayment.Text = "" lblDisplay.Caption = "" txtName.SetFocus End Sub 9. Close this code window to return to your form. 10.Repeat step 4 for Your Installment command button. www.ppk.kpm.my < 36 >
  • 38. Learning Module: Programming 11.Type the details below between Private Sub cmdInstalment_Click() and End Sub. Private Sub cmdInstalment_Click() Dim Loan As Currency Dim Price As Currency Dim Interest As Single Dim Instalment As Currency Dim Payment As Currency Price = Val(txtPrice.Text) Interest = Val(txtInterest.Text) Payment = Val(txtPayment.Text) If txtName.Text = "" Then MsgBox "Plese enter customer name", vbCritical, "Name" If cboIncome.ListIndex < 1 Then lblDisplay.Caption = "Sorry, your income is not elligible to apply a loan" Else If optG10.Value Then Year = 10 Loan = Price - Payment Type Instalment = (((Loan * (Interest / 100)) * Year + Loan) / (Year * 12)) this lblDisplay.Caption = "RM" & Format(Instalment, "#####0.00") part ElseIf optG7.Value Or optP7.Value Then Year = 7 Loan = Price - Payment Instalment = (((Loan * (Interest / 100)) * Year + Loan) / (Year * 12)) lblDisplay.Caption = "RM" & Format(Instalment, "#####0.00") ElseIf optG5.Value Or optP5.Value Then Year = 5 Loan = Price - Payment Instalment = (((Loan * (Interest / 100)) * Year + Loan) / (Year * 12)) lblDisplay.Caption = "RM" & Format(Instalment, "#####0.00") Else MsgBox "Please choose your period of year", vbCritical, "Number of year" End If End If End Sub 12.Close this code window to return to your form. www.ppk.kpm.my < 37 >
  • 39. Learning Module: Programming j). Saving the Program Now that you have completed the Enviro program, you should save it to a disk. To save a program in Visual Basic, click Save Project As on the File menu or click the Save Project button on the toolbar. 1. On the File menu, click the Save Project As command. (You can save your program at any time during the programming process.) 2. The Save File As dialog box appears, prompting you for the name and storage location for your form. 3. Type Enviro in the File Name text box, and press Enter. 4. The form is saved under the name Enviro.frm. The Save Project As dialog box then appears in Figure 19. My Document Enviro Enviro Figure 19: The Save Project As dialog box 5. Type Enviro and press Enter. 6. The Enviro project is saved under the name Enviro.vbp. www.ppk.kpm.my < 38 >
  • 40. Learning Module: Programming SUBTOPIC : 5.2.2 Develop A Program D. Phase 4 – Testing and Debugging LEARNING OUTCOMES By using this module, you should be able to: 1. test the program; 2. debug problems; and 3. compile the program. DURATION : 4 periods a). Test the program 1. To test a Visual Basic program from the programming environment, you can choose either one of the followings: (a) click Start on the Run menu; (b) click the Start button on the toolbar; and (c) press F5. When you test it and your program does not contain any errors, then you have successfully produced a good Enviro program. It should produce the correct and accurate result to solve the company problem. b). Debug the program 1. If the program you tested just now cannot run properly, meaning your program has a few errors. The action of removing these errors is called debugging. www.ppk.kpm.my < 39 >
  • 41. Learning Module: Programming 2. If Visual Basic displays an error message like the picture shown below, you may still have a typing mistake or two in your program code. See Figure 20. Figure 20: The error message displayed while running a program 3. Try to debug (correct the errors) by comparing the printed version in this module (Page 15 - 38) with the one you typed in Visual Basic. 4. You should test the program several time until it can run smoothly. 5. You should also check on the result you test on the screen whether it is the one you wanted. If not, check again on Page 15 - 38. 6. If the problems still arise, you should consult your friends or teacher. c). Compile the program 1. In Visual Basic, compiling a program means to make an executable file. This executable file should be free of errors and can run successfully. 2. On the File menu, click the Make Enviro.exe command. (Visual Basic adds your program’s name to the command automatically when you have saved a previous copy.) www.ppk.kpm.my < 40 >
  • 42. Learning Module: Programming 3. The Make Project dialog box appears, as in Figure 21. My Document Enviro Enviro Figure 21: The Make Project dialog box 4. The executable Enviro file is saved under the name Enviro.exe. 5. You can save this Enviro.exe program in a mobile disk and run it on any computers. To run this program, the computer does not have to install a Visual Basic program. www.ppk.kpm.my < 41 >
  • 43. Learning Module: Programming SUBTOPIC : 5.2.2 Develop A Program E. Phase 5 - Documentation LEARNING OUTCOMES By using this module, you should be able to 1. create internal documentation; and 2. gather all the documents from all the phases into a folio for external documentation. Student previous knowledge € Student should able to do print screen DURATION : 2 periods I). READING ACTIVITY a). Internal Documentation Internal documentation is the comment created within the program by the programmer. Internal documentation is used to provide information about the program. Generally, this type of documentation is called a comment, and explains the purpose of a particular line of code or why the programmer used a particular procedure. An example of internal documentation is shown below: Note that the comments use a single quotation mark (') ahead of them, and that they appear in green. Internal documentation is important because it provides information to programmers who may not be familiar with a particular program. www.ppk.kpm.my < 42 >
  • 44. Learning Module: Programming b). External Documentation External documentation is usually a printed manual about the program, how it works, how to install it, or how to use it (user documentation). Sometimes external documentation is provided as a word processing document on the program disk, or as a manual for a user to read. A readme file is a type of external documentation. User guides and installation manuals are also types of printed external documentation. In this module, you will need to create both internal and external documentations for your program as you work through the project. II). WRITING ACTIVITY 1. Type a few comments (internal documentation) in your coding and submit all the related Visual Basic files in a diskette to your teacher. 2. Type the minimum requirements for your customer to install in your program. You may add more specifications in the table so that your customer can run your program smoothly. No. Specifications Minimum Requirements 1. Processor type (e.g. Intel Pentium 3) 2. Hard Disk capacity (e.g. 10GB) 3 Size of RAM (e.g. 128MB) 4 Screen Resolutions (e.g. 800x600 pixels) 5 Type of Operating Systems (e.g. Window 98) www.ppk.kpm.my < 43 >
  • 45. Learning Module: Programming 3. You are going to write a simple user guide here. Write the steps on teaching your customer to install the program into his computer. CONGRATULATIONS !! YOU HAVE SUCCESSFULLY COMPLETED THIS MODULE. YOU ARE NOW ABLE TO APPLY THE NECESSARY PROGRAMMING SKILL. www.ppk.kpm.my < 44 >