SlideShare a Scribd company logo
1 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Objectives


                In this session, you will learn to:
                   Use the dry run table
                   Identify repetitive processes
                   Identify modular approach to programming




     Ver. 1.0                          Session 3              Slide 1 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Using Dry Run


                Helps you do a logic check
                Understand the flow of control in a flowchart
                Evaluate the output of the program with a set of sample
                values
                Provides a step by step evaluation of values in the variables
                of the program




     Ver. 1.0                        Session 3                         Slide 2 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Using Dry Run (Contd.)


                Example:
                   All candidates have to take three tests. A candidate is selected
                   for the interview round based on the scores of all the three
                   tests. The individual score in each test has to be greater than
                   75 and the average score across the three tests should be a
                   minimum of 80. The call letter for the interview is to be sent to
                   candidates who have been selected and a rejection letter is to
                   be sent to the rest. Represent the logic for the above process
                   by using a flowchart.




     Ver. 1.0                          Session 3                             Slide 3 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Using Dry Run (Contd.)


                Flowchart to select a candidate
                                    Start


                              Declare Variables



                            Accept Values and
                            Calculate nAverage



                                   Is
                            nAverage>= 80 AND         No   Display “ Rejection
                             nTest1 > 75 AND                letter to be sent”
                             nTest2 > 75 AND
                              nTest3 > 75 ?

                                        Yes
                             Display “Interview
                            call letter to be sent”


                                   Stop

     Ver. 1.0                          Session 3                                 Slide 4 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Using Dry Run (Contd.)


                Dry Run Table:

                S.No.   nTest1   nTest2    nTest 3    nAverage   Output

                1.      95       90        88         91         Interview call letter to be sent

                2.      80       77        83         80         Interview call letter to be sent

                3.      90       92        74         85.33      Rejection letter to be sent

                4.      76       76        76         76         Rejection letter to be sent




     Ver. 1.0                             Session 3                                      Slide 5 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration


                An important characteristic of a computer is its ability to
                execute a series of instructions repeatedly.
                A loop is a sequence of instructions that will be repeated
                more than once.
                A loop performs steps in a specified sequence.
                There are two types of loops:
                   fixed loops where the number of repetitions is known
                   variable loops where the number of repetitions is not known




     Ver. 1.0                         Session 3                            Slide 6 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                Example:
                   Flowchart to display the sum of ten numbers
                                       Start

                                   numeric nNum,
                                  nSum, nCounter

                                     nCounter=0
                                      nSum=0

                                    Accept nNum


                                 nSum=nSum+nNum


                                 nCounter=nCounter+1



                           Yes         Is          No
                                   nCounter<10 ?        Display nSum

                                                                       Stop

     Ver. 1.0                              Session 3                          Slide 7 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                Dry Run Table:

                     S. No.       nNum       nSum         nCounter    Output
                0.            -          0                0
                1.            5          5                1
                2.            12         17               2
                3.            7          24               3
                4.            6          30               4
                5.            2          32               5
                6.            10         42               6
                7.            8          50               7
                8.            3          53               8
                9.            16         69               9
                10.           4          73               10         73




     Ver. 1.0                                 Session 3                        Slide 8 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                Example:
                   You have been assigned the responsibility of generating an
                   address list of all the people working in your office. For each
                   person, you will need to accept the name, address, and the
                   telephone number and print a list containing the collated
                   details.




     Ver. 1.0                          Session 3                              Slide 9 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                     Flowchart segment to display employee details of 25 people


                                   nCounter = 1


                                      Is            No
                                  nCounter<=25?

                                         Yes              Stop
                                  Accept cName


                                Accept cAddress


                                 Accept cTelno


                                  Display cName,
                                 cAddress, cTelno


                               nCounter=nCounter+
                               1
     Ver. 1.0                          Session 3                             Slide 10 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                Example:
                   Let us look at the same example of preparing the test
                   performance report in the decision-making section again. Now,
                   apart from finding out whether a candidate has to be sent a call
                   letter or a rejection letter, we also have to calculate the number
                   of candidates who have been sent interview call letters and the
                   number of candidates who have been sent rejection letters,
                   using a flowchart.




     Ver. 1.0                          Session 3                             Slide 11 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                     Flowchart to calculate the total number of call letters and rejection
                     letters sent
                                            Start

                                     Variable Declaration


                                        Accept Values



                                             Is
                                     nAverage >=80 AND            No
                                      nTest1 > 75 AND                  nTotReject=nTotReject+1
                                      nTest2 > 75 AND
                                        nTest3 > 75 ?


                                                  Yes

                                   nTotSelect=nTotSelect+1


                                                        Process
                           A                  B


     Ver. 1.0                          Session 3                                           Slide 12 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                     Flowchart to calculate the total number of call letters and rejection
                     letters sent (Contd.)

                                            B
                       A


                                     Display “Any more
                                     candidates (Y/N)? ”



                                      Accept cChoice



                                          Is               No
                                     cChoice = “Y”?


                                              Yes     Display nTotSelect
                                                      Display nTotReject



                                                                Stop

     Ver. 1.0                          Session 3                                  Slide 13 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Iteration (Contd.)


                              Dry Run Table:

                S. No.   nTest1     nTest2     nTest3   nAverage   Output
                1.       95         90         88       91         nTotSelect is incremented by 1.
                2.       80         77         83       80         nTotSelect is incremented by 1.
                3.       90         92         74       85.33      nTotReject is incremented by 1.
                4.       76         76         76       76         nTotReject is incremented by 1.




     Ver. 1.0                                   Session 3                                  Slide 14 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming


                A program needs to be amended periodically to respond to
                changing conditions or requirements.
                This encouraged programmers to adopt a more disciplined
                approach to program writing.
                The techniques that were adopted are known as modular
                or structured programming techniques.
                Modular programming includes features that are designed
                not only to solve the problem at hand but also to make the
                logic clear to someone reading the program.




     Ver. 1.0                       Session 3                        Slide 15 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming (Contd.)


                Long, continuous programs can be broken up into a series
                of individual modules that are related to each other in a
                specified manner.

                                          Main
                                        Program




                         Module1        Module2     Module3




     Ver. 1.0                       Session 3                       Slide 16 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming (Contd.)


                Example:
                   Flowchart to show modular programming
                           Start


                     numeric nNum1,                        Add
                   nNum2, nNum3, nSum

                                                    nSum=nNum1 + nNum2
                      Accept nNum1,                       + nNum3
                      nNum2, nNum3

                                                           Return
                           Add



                      Display nSum



                           Stop


     Ver. 1.0                           Session 3                        Slide 17 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming (Contd.)


                Example:
                   Accept the test scores for 10 students and display their
                   individual averages. The scores of the students cannot be
                   negative.
                   The table shows the variables used in the flowchart.
                Variable                    Data Type       Variable Name

                Student Name                character       cStudentName

                Score of Test 1             numeric         nTest1

                Score of Test 2             numeric         nTest2

                Score of Test 3             numeric         nTest3

                Average of Test Scores      numeric         nAverage


     Ver. 1.0                         Session 3                             Slide 18 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming (Contd.)


                                Flowchart to calculate average marks of 10 students
                                                             Accept


                                                    Accept cStudentName

                       Accept                                                                     Average
                                                        Accept nTest1

                                                                                          nAverage=(nTest1+nTest2
                      Average                           Accept nTest2                                 +nTest3) / 3


                                                        Accept nTest3                              Return
                Display cStudentName,
                      nAverage
                                                            Is
                                                      nTest1>=0 AND            Yes
                                                      nTest2>=0 AND
                                                       nTest3>=0 ?

                                                               No                Return

                                                  Display “Test score cannot
                                                     be less than zero”

     Ver. 1.0                                    Session 3                                              Slide 19 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming (Contd.)


                Example:
                   The total expenditure on salaries for the month needs to be
                   calculated. As per company policy an employee receives a
                   minimum of $500. Depict the logic for automating the task by
                   using flowcharts.
                   The table shows the variables used in the flowchart.

                 Variable                 Data Type          Variable Name

                 Employee code            character          cEmpCode

                 Employee salary          numeric            nSalary

                 Total salary             numeric            nTotSalary

                 Choice                   character          cChoice



     Ver. 1.0                         Session 3                              Slide 20 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming (Contd.)


                             Flowchart to calculate total monthly expenditure on salaries


                                                  Accept



                      Is          No                                                     Summation
                cChoice = “Y” ?                Accept nSalary


                       Yes
                                                                                nTotSalary=nTotSalary+nSalary
                                                     Is          Yes
                   Accept                     nSalary >=500 ?

                                                                       Return              Return
                                                      No
                Summation                   Display ”Salary cannot
                                            be less than $500”




     Ver. 1.0                                 Session 3                                        Slide 21 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Identifying Modular Approach to Programming (Contd.)


                      Dry Run Table:

                S. No.   nSalary       nTotSalary      Output
                1.       -             0
                2.       4500          4500
                3.       5500          10000
                4.       3400          13400
                5.       5600          19000
                6.       3000          22000
                7.       5000          27000
                8.       450           27000           Salary cannot be less than $500
                9.       9000          36000
                10.      8900          44900
                11.      4500          49400           49400




     Ver. 1.0                              Session 3                                 Slide 22 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation




                           Exercises



     Ver. 1.0                Session 3                    Slide 23 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 1


                Draw a flowchart to print the product of the first 10 even
                numbers.




     Ver. 1.0                         Session 3                         Slide 24 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 2


                Draw a flowchart to accept 50 numbers and also display the
                total number of odd and even numbers.




     Ver. 1.0                       Session 3                       Slide 25 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 3


                Draw a flowchart to display the highest of any 10 numbers
                entered.




     Ver. 1.0                       Session 3                        Slide 26 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 4


                Draw a flowchart that accepts input from a user and
                displays the result, depending on whether the user wishes
                to multiply or divide the numbers provided as input. The
                Multiply module of the program can multiply maximum of
                three numbers. The Divide module of the program should
                check that the denominator should not be zero.




     Ver. 1.0                       Session 3                        Slide 27 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Summary


                In this session, you learned that:
                   The concept of dry run will help you perform a logic check and
                   understand the flow of control in a flowchart.
                   A loop is a sequence of instructions that will be repeated more
                   than once.
                   A loop performs steps in a specified sequence.
                   There are two types of loops:
                       Fixed loops where the number of repetitions is known
                       Variable loops where the number of repetitions is not known




     Ver. 1.0                           Session 3                               Slide 28 of 29
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Summary (Contd.)


                Statements within a loop will be executed repeatedly
                 until the condition becomes false.
                The structured programming technique is a disciplined
                 approach to program writing.
                A large program can be divided into several modules, where
                each module performs a specific task. A module is also called
                a procedure.
                A procedure or a module is invoked from the main program
                and the control is returned from the procedure to the main
                program by using the return statement.




     Ver. 1.0                      Session 3                           Slide 29 of 29

More Related Content

What's hot

06 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_0806 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_08Niit Care
 
11 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_1611 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_16Niit Care
 
13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19Niit Care
 
12 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_1712 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_17Niit Care
 
07 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_1007 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_10Niit Care
 
04 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_0504 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_05Niit Care
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01Niit Care
 
08 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_1108 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_11Niit Care
 
Unit testing and scaffolding
Unit testing and scaffoldingUnit testing and scaffolding
Unit testing and scaffoldingValerio Maggio
 
03 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_0403 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_04Niit Care
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentValerio Maggio
 
09 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_1309 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_13Niit Care
 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testingmalcolmt
 

What's hot (17)

06 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_0806 iec t1_s1_oo_ps_session_08
06 iec t1_s1_oo_ps_session_08
 
11 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_1611 iec t1_s1_oo_ps_session_16
11 iec t1_s1_oo_ps_session_16
 
13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19
 
12 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_1712 iec t1_s1_oo_ps_session_17
12 iec t1_s1_oo_ps_session_17
 
07 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_1007 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_10
 
04 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_0504 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_05
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01
 
08 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_1108 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_11
 
Unit testing and scaffolding
Unit testing and scaffoldingUnit testing and scaffolding
Unit testing and scaffolding
 
03 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_0403 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_04
 
MD51 Lab Manual
MD51 Lab ManualMD51 Lab Manual
MD51 Lab Manual
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
 
09 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_1309 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_13
 
P&MSP2012 - Unit Testing
P&MSP2012 - Unit TestingP&MSP2012 - Unit Testing
P&MSP2012 - Unit Testing
 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testing
 
AAA Automated Testing
AAA Automated TestingAAA Automated Testing
AAA Automated Testing
 

Viewers also liked

04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05Niit Care
 
07 asp.net session10
07 asp.net session1007 asp.net session10
07 asp.net session10Niit Care
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08Niit Care
 
Aae oop xp_06
Aae oop xp_06Aae oop xp_06
Aae oop xp_06Niit Care
 
Deawsj 7 ppt-2_c
Deawsj 7 ppt-2_cDeawsj 7 ppt-2_c
Deawsj 7 ppt-2_cNiit Care
 
Vb.net session 07
Vb.net session 07Vb.net session 07
Vb.net session 07Niit Care
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04Niit Care
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02Niit Care
 
Ado.net session10
Ado.net session10Ado.net session10
Ado.net session10Niit Care
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02Pooja Gupta
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01Niit Care
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02Niit Care
 

Viewers also liked (14)

04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
07 asp.net session10
07 asp.net session1007 asp.net session10
07 asp.net session10
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
Aae oop xp_06
Aae oop xp_06Aae oop xp_06
Aae oop xp_06
 
Deawsj 7 ppt-2_c
Deawsj 7 ppt-2_cDeawsj 7 ppt-2_c
Deawsj 7 ppt-2_c
 
Vb.net session 07
Vb.net session 07Vb.net session 07
Vb.net session 07
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
 
Ado.net session10
Ado.net session10Ado.net session10
Ado.net session10
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 

Similar to 03 iec t1_s1_plt_session_03

Software Testing for Data Scientists
Software Testing for Data ScientistsSoftware Testing for Data Scientists
Software Testing for Data ScientistsAjay Ohri
 
Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)Cdiscount
 
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202Mahmoud Samir Fayed
 
2011 ecoop
2011 ecoop2011 ecoop
2011 ecoopbergel
 
The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88Mahmoud Samir Fayed
 
Checking the Qt 5 Framework
Checking the Qt 5 FrameworkChecking the Qt 5 Framework
Checking the Qt 5 FrameworkAndrey Karpov
 
maXbox Starter 43 Work with Code Metrics ISO Standard
maXbox Starter 43 Work with Code Metrics ISO StandardmaXbox Starter 43 Work with Code Metrics ISO Standard
maXbox Starter 43 Work with Code Metrics ISO StandardMax Kleiner
 
Yevhen Tatarynov "From POC to High-Performance .NET applications"
Yevhen Tatarynov "From POC to High-Performance .NET applications"Yevhen Tatarynov "From POC to High-Performance .NET applications"
Yevhen Tatarynov "From POC to High-Performance .NET applications"LogeekNightUkraine
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184Mahmoud Samir Fayed
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up Craig Schumann
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialTo Sum It Up
 
Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)ExcellenceAcadmy
 
Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)ExcellenceAcadmy
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlowOswald Campesato
 
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the UglyKotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the UglyHaim Yadid
 
關於測試,我說的其實是......
關於測試,我說的其實是......關於測試,我說的其實是......
關於測試,我說的其實是......hugo lu
 
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez XebiaXebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez XebiaPublicis Sapient Engineering
 

Similar to 03 iec t1_s1_plt_session_03 (20)

Software Testing for Data Scientists
Software Testing for Data ScientistsSoftware Testing for Data Scientists
Software Testing for Data Scientists
 
Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)
 
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202
 
2011 ecoop
2011 ecoop2011 ecoop
2011 ecoop
 
Data race
Data raceData race
Data race
 
The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88
 
Checking the Qt 5 Framework
Checking the Qt 5 FrameworkChecking the Qt 5 Framework
Checking the Qt 5 Framework
 
maXbox Starter 43 Work with Code Metrics ISO Standard
maXbox Starter 43 Work with Code Metrics ISO StandardmaXbox Starter 43 Work with Code Metrics ISO Standard
maXbox Starter 43 Work with Code Metrics ISO Standard
 
GW SDAB Dev Tools 2012
GW SDAB Dev Tools 2012GW SDAB Dev Tools 2012
GW SDAB Dev Tools 2012
 
Yevhen Tatarynov "From POC to High-Performance .NET applications"
Yevhen Tatarynov "From POC to High-Performance .NET applications"Yevhen Tatarynov "From POC to High-Performance .NET applications"
Yevhen Tatarynov "From POC to High-Performance .NET applications"
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 
Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)
 
Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
 
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the UglyKotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
Kotlin Backend Development 6 Yrs Recap. The Good, the Bad and the Ugly
 
關於測試,我說的其實是......
關於測試,我說的其實是......關於測試,我說的其實是......
關於測試,我說的其實是......
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez XebiaXebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
XebiCon'16 : Server-Side Swift. Par Simone Civetta, Développeur iOS chez Xebia
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 

Recently uploaded

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

03 iec t1_s1_plt_session_03

  • 1. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Objectives In this session, you will learn to: Use the dry run table Identify repetitive processes Identify modular approach to programming Ver. 1.0 Session 3 Slide 1 of 29
  • 2. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Using Dry Run Helps you do a logic check Understand the flow of control in a flowchart Evaluate the output of the program with a set of sample values Provides a step by step evaluation of values in the variables of the program Ver. 1.0 Session 3 Slide 2 of 29
  • 3. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Using Dry Run (Contd.) Example: All candidates have to take three tests. A candidate is selected for the interview round based on the scores of all the three tests. The individual score in each test has to be greater than 75 and the average score across the three tests should be a minimum of 80. The call letter for the interview is to be sent to candidates who have been selected and a rejection letter is to be sent to the rest. Represent the logic for the above process by using a flowchart. Ver. 1.0 Session 3 Slide 3 of 29
  • 4. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Using Dry Run (Contd.) Flowchart to select a candidate Start Declare Variables Accept Values and Calculate nAverage Is nAverage>= 80 AND No Display “ Rejection nTest1 > 75 AND letter to be sent” nTest2 > 75 AND nTest3 > 75 ? Yes Display “Interview call letter to be sent” Stop Ver. 1.0 Session 3 Slide 4 of 29
  • 5. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Using Dry Run (Contd.) Dry Run Table: S.No. nTest1 nTest2 nTest 3 nAverage Output 1. 95 90 88 91 Interview call letter to be sent 2. 80 77 83 80 Interview call letter to be sent 3. 90 92 74 85.33 Rejection letter to be sent 4. 76 76 76 76 Rejection letter to be sent Ver. 1.0 Session 3 Slide 5 of 29
  • 6. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration An important characteristic of a computer is its ability to execute a series of instructions repeatedly. A loop is a sequence of instructions that will be repeated more than once. A loop performs steps in a specified sequence. There are two types of loops: fixed loops where the number of repetitions is known variable loops where the number of repetitions is not known Ver. 1.0 Session 3 Slide 6 of 29
  • 7. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Example: Flowchart to display the sum of ten numbers Start numeric nNum, nSum, nCounter nCounter=0 nSum=0 Accept nNum nSum=nSum+nNum nCounter=nCounter+1 Yes Is No nCounter<10 ? Display nSum Stop Ver. 1.0 Session 3 Slide 7 of 29
  • 8. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Dry Run Table: S. No. nNum nSum nCounter Output 0. - 0 0 1. 5 5 1 2. 12 17 2 3. 7 24 3 4. 6 30 4 5. 2 32 5 6. 10 42 6 7. 8 50 7 8. 3 53 8 9. 16 69 9 10. 4 73 10 73 Ver. 1.0 Session 3 Slide 8 of 29
  • 9. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Example: You have been assigned the responsibility of generating an address list of all the people working in your office. For each person, you will need to accept the name, address, and the telephone number and print a list containing the collated details. Ver. 1.0 Session 3 Slide 9 of 29
  • 10. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Flowchart segment to display employee details of 25 people nCounter = 1 Is No nCounter<=25? Yes Stop Accept cName Accept cAddress Accept cTelno Display cName, cAddress, cTelno nCounter=nCounter+ 1 Ver. 1.0 Session 3 Slide 10 of 29
  • 11. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Example: Let us look at the same example of preparing the test performance report in the decision-making section again. Now, apart from finding out whether a candidate has to be sent a call letter or a rejection letter, we also have to calculate the number of candidates who have been sent interview call letters and the number of candidates who have been sent rejection letters, using a flowchart. Ver. 1.0 Session 3 Slide 11 of 29
  • 12. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Flowchart to calculate the total number of call letters and rejection letters sent Start Variable Declaration Accept Values Is nAverage >=80 AND No nTest1 > 75 AND nTotReject=nTotReject+1 nTest2 > 75 AND nTest3 > 75 ? Yes nTotSelect=nTotSelect+1 Process A B Ver. 1.0 Session 3 Slide 12 of 29
  • 13. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Flowchart to calculate the total number of call letters and rejection letters sent (Contd.) B A Display “Any more candidates (Y/N)? ” Accept cChoice Is No cChoice = “Y”? Yes Display nTotSelect Display nTotReject Stop Ver. 1.0 Session 3 Slide 13 of 29
  • 14. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Iteration (Contd.) Dry Run Table: S. No. nTest1 nTest2 nTest3 nAverage Output 1. 95 90 88 91 nTotSelect is incremented by 1. 2. 80 77 83 80 nTotSelect is incremented by 1. 3. 90 92 74 85.33 nTotReject is incremented by 1. 4. 76 76 76 76 nTotReject is incremented by 1. Ver. 1.0 Session 3 Slide 14 of 29
  • 15. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming A program needs to be amended periodically to respond to changing conditions or requirements. This encouraged programmers to adopt a more disciplined approach to program writing. The techniques that were adopted are known as modular or structured programming techniques. Modular programming includes features that are designed not only to solve the problem at hand but also to make the logic clear to someone reading the program. Ver. 1.0 Session 3 Slide 15 of 29
  • 16. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming (Contd.) Long, continuous programs can be broken up into a series of individual modules that are related to each other in a specified manner. Main Program Module1 Module2 Module3 Ver. 1.0 Session 3 Slide 16 of 29
  • 17. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming (Contd.) Example: Flowchart to show modular programming Start numeric nNum1, Add nNum2, nNum3, nSum nSum=nNum1 + nNum2 Accept nNum1, + nNum3 nNum2, nNum3 Return Add Display nSum Stop Ver. 1.0 Session 3 Slide 17 of 29
  • 18. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming (Contd.) Example: Accept the test scores for 10 students and display their individual averages. The scores of the students cannot be negative. The table shows the variables used in the flowchart. Variable Data Type Variable Name Student Name character cStudentName Score of Test 1 numeric nTest1 Score of Test 2 numeric nTest2 Score of Test 3 numeric nTest3 Average of Test Scores numeric nAverage Ver. 1.0 Session 3 Slide 18 of 29
  • 19. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming (Contd.) Flowchart to calculate average marks of 10 students Accept Accept cStudentName Accept Average Accept nTest1 nAverage=(nTest1+nTest2 Average Accept nTest2 +nTest3) / 3 Accept nTest3 Return Display cStudentName, nAverage Is nTest1>=0 AND Yes nTest2>=0 AND nTest3>=0 ? No Return Display “Test score cannot be less than zero” Ver. 1.0 Session 3 Slide 19 of 29
  • 20. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming (Contd.) Example: The total expenditure on salaries for the month needs to be calculated. As per company policy an employee receives a minimum of $500. Depict the logic for automating the task by using flowcharts. The table shows the variables used in the flowchart. Variable Data Type Variable Name Employee code character cEmpCode Employee salary numeric nSalary Total salary numeric nTotSalary Choice character cChoice Ver. 1.0 Session 3 Slide 20 of 29
  • 21. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming (Contd.) Flowchart to calculate total monthly expenditure on salaries Accept Is No Summation cChoice = “Y” ? Accept nSalary Yes nTotSalary=nTotSalary+nSalary Is Yes Accept nSalary >=500 ? Return Return No Summation Display ”Salary cannot be less than $500” Ver. 1.0 Session 3 Slide 21 of 29
  • 22. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Identifying Modular Approach to Programming (Contd.) Dry Run Table: S. No. nSalary nTotSalary Output 1. - 0 2. 4500 4500 3. 5500 10000 4. 3400 13400 5. 5600 19000 6. 3000 22000 7. 5000 27000 8. 450 27000 Salary cannot be less than $500 9. 9000 36000 10. 8900 44900 11. 4500 49400 49400 Ver. 1.0 Session 3 Slide 22 of 29
  • 23. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercises Ver. 1.0 Session 3 Slide 23 of 29
  • 24. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 1 Draw a flowchart to print the product of the first 10 even numbers. Ver. 1.0 Session 3 Slide 24 of 29
  • 25. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 2 Draw a flowchart to accept 50 numbers and also display the total number of odd and even numbers. Ver. 1.0 Session 3 Slide 25 of 29
  • 26. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 3 Draw a flowchart to display the highest of any 10 numbers entered. Ver. 1.0 Session 3 Slide 26 of 29
  • 27. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 4 Draw a flowchart that accepts input from a user and displays the result, depending on whether the user wishes to multiply or divide the numbers provided as input. The Multiply module of the program can multiply maximum of three numbers. The Divide module of the program should check that the denominator should not be zero. Ver. 1.0 Session 3 Slide 27 of 29
  • 28. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Summary In this session, you learned that: The concept of dry run will help you perform a logic check and understand the flow of control in a flowchart. A loop is a sequence of instructions that will be repeated more than once. A loop performs steps in a specified sequence. There are two types of loops: Fixed loops where the number of repetitions is known Variable loops where the number of repetitions is not known Ver. 1.0 Session 3 Slide 28 of 29
  • 29. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Summary (Contd.) Statements within a loop will be executed repeatedly until the condition becomes false. The structured programming technique is a disciplined approach to program writing. A large program can be divided into several modules, where each module performs a specific task. A module is also called a procedure. A procedure or a module is invoked from the main program and the control is returned from the procedure to the main program by using the return statement. Ver. 1.0 Session 3 Slide 29 of 29