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


                In this session, you will learn to:
                   Identify variables and constants
                   Use data types
                   Use operators
                   Represent decisions in a flowchart




     Ver. 1.0                          Session 2          Slide 1 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Variables and Constants


                Example:
                   Flowchart to display the sum of two numbers
                                        Start



                                    Accept the
                                    First Number



                                   Accept the
                                   Second Number


                                  Add the two Numbers
                                  and Store the Result


                                  Display the Result



                                         Stop

     Ver. 1.0                          Session 2                 Slide 2 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Variables and Constants (Contd.)


                The internal memory consists of different locations in which
                data is stored.
                A computer needs to identify the memory locations to be
                able to retrieve values from or store values in them.
                The value of a variable changes each time the set of
                instructions is executed.




     Ver. 1.0                        Session 2                         Slide 3 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Variables and Constants (Contd.)


                The values stored in the variables are known as constants.


                                     Constants




                            10          15         25


                           nNum1       nNum2       nSum




                                      Variables




     Ver. 1.0                       Session 2                        Slide 4 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Variables and Constants (Contd.)


                Example:
                   Flowchart to display the sum of two numbers using variables
                                         Start




                                     Accept nNum1




                                    Accept nNum2




                                  nSum = nNum1 + nNum2



                                     Display nSum



                                          Stop

     Ver. 1.0                         Session 2                           Slide 5 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Just a minute


                Each day, the courier service delivers some letters. The
                number of letters is different each day. Regardless of the
                number of letters delivered by the courier service, they are
                paid a carrying charge of $5. Identify the variable and
                constant data in this situation.
                   Variable:
                   Constant:



                 Answer:
                     Variable: Number of letters
                     Constant: Carrying charge $5




     Ver. 1.0                         Session 2                         Slide 6 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Just a minute


                Identify the variables and constants from the following list:
                 1. Age
                 2. Address
                 3. 21
                 4. “10, Kingsway Camp”
                 5. “Henri”
                 6. Name
                 7. “185”


                 Answer:
                     Constants: 21, “10, Kingsway Camp”, “Henri”, “185”
                     Variables: Age, Address, Name



     Ver. 1.0                         Session 2                           Slide 7 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Numeric


                Numeric variables can contain only numbers.
                These variables can be used in arithmetic operations.




     Ver. 1.0                       Session 2                           Slide 8 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Character


                Character variables can contain any combination of letters,
                numbers, and special characters.
                These variables cannot be used for calculation.




     Ver. 1.0                        Session 2                        Slide 9 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Declaring Variables


                Example:
                                   Start


                               numeric nNum1,       Declaration
                                nNum2, nSum         of Variables



                              Accept nNum1



                             Accept nNum2



                           nSum = nNum1 + nNum2



                               Display nSum



                                  Stop



     Ver. 1.0                     Session 2                  Slide 10 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Variable Naming Conventions


                The first letter of the variable may indicate the data type
                used.
                The variable name should clearly describe its purpose.
                In case of multiple words, the first letter of each word could
                be capitalized for better readability.




     Ver. 1.0                         Session 2                          Slide 11 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Using Operators


                Operators are symbols for some predefined operations.
                The operators that are used in flowcharts are:
                   Arithmetic operators
                   Relational operators
                   Logical operators




     Ver. 1.0                         Session 2                    Slide 12 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Arithmetic Operators


                Arithmetic operators are used to perform arithmetic
                calculations.
                The symbols that represent arithmetic operations are called
                arithmetic operators (*, /, +, -, %).




     Ver. 1.0                       Session 2                        Slide 13 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Relational Operators


                Relational operators are used to test the relationship
                between two variables or the relationship between a
                variable and a constant.
                There are six relational operators (=,>,<,!=,>=,<=).




     Ver. 1.0                        Session 2                           Slide 14 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Logical Operators


                Logical operators (AND, OR, NOT) are used to combine
                expressions containing relational operators:
                   nNum1 = 7 AND nNum2 > 5
                   nNum1 = 7 OR nNum2 > 5
                   NOT nNum2 <= 5
                The order of precedence for the execution of logical
                operators is NOT, AND, and OR.




     Ver. 1.0                        Session 2                         Slide 15 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Just a minute


                Draw a flowchart to accept item name, price, and quantity.
                You need to calculate the value as the product of price and
                quantity, and display the calculated value and the item
                name using variables.




     Ver. 1.0                        Session 2                        Slide 16 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Just a minute (Contd.)


                Answer:
                                       Start

                               character cltemName
                          numeric nPrice, nQuantity, nValue


                                 Accept cItemName



                                  Accept nPrice


                                 Accept nQuantity



                            nValue = nPrice * nQuantity


                            Display cItemName, nValue


                                      Stop

     Ver. 1.0                          Session 2              Slide 17 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart


                Many problems require decisions to be made.
                All decisions may or may not state an action to be taken if
                the condition is false.
                Following is a flowchart segment to compare two numbers
                and check for equality.


                                    Is nNum1 =    No
                                      nNum2 ?


                                          Yes


                                   Display “The        Display “The
                                   numbers are         numbers are
                                      equal”            not equal”




     Ver. 1.0                         Session 2                       Slide 18 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                Example:
                   Accept two numbers and print the larger of the two numbers

                                         Start


                                     numeric nNum1,
                                        nNum2



                                    Accept nNum1




                                    Accept nNum2




                                         A



     Ver. 1.0                        Session 2                           Slide 19 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                Example (Contd.):
                                         A



                                     Is             Yes     Display “ The
                                nNum1=nNum2?
                                                          numbers are equal”


                                             No

                                     Is             Yes
                                nNum1>nNum2?              Display nNum1


                                             No


                                    Display nNum2



                                        Stop


     Ver. 1.0                          Session 2                               Slide 20 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                Example:
                   Print the value of nX only if the value of nX is greater than 10
                   and nX is an even number
                                                      Start


                                                   numeric nX



                                                   Accept nX



                                                       Is
                                                                No
                                                   nX>10 AND
                                                    nX%2=0?

                                                        Yes

                                                   Display nX



                                                      Stop

     Ver. 1.0                          Session 2                              Slide 21 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                Example:
                   Accept the year and then determine whether the year is a leap
                   year or not. A leap year is one that is divisible by 4, other than
                   a century year, such as 1900. A century year, which is divisible
                   by 400, such as 2000, is also a leap year.
                   To evaluate the given condition, we can interpret this as:
                    • If year is divisible by 4 AND not divisible by 100 OR divisible by
                      400, it is a leap year.




     Ver. 1.0                           Session 2                                  Slide 22 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                     Flowchart to determine a leap year


                                   Start


                               numeric nYear



                              Display “Please
                                 enter a year”



                             Accept nYear



                                   A




     Ver. 1.0                      Session 2              Slide 23 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                     Flowchart to determine a leap year (Contd.)



                              A




                             Is
                      nYear % 4=0 AND
                                                No   Display “This is
                      (nYear % 100 !=0 OR
                       nYear % 400=0) ?              not a leap year”




                                  Yes

                       Display “This is
                         a leap year”



                             Stop



     Ver. 1.0                           Session 2                       Slide 24 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                Example:
                   To decide about the discount percentage on a TV, the sales
                   person needs to check the type of TV. If the TV is Black and
                   White [B], the discount will be 5 percent of the selling price. If
                   the type of TV is colored[C], then he has to verify the size of
                   TV screen. For 14 inches screen, discount is 8 percent of the
                   selling price and for 21 inches screen, the discount is 10
                   percent of the selling price.




     Ver. 1.0                           Session 2                              Slide 25 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Representing Decisions in a Flowchart (Contd.)


                       Flowchart to calculate discount
                          Start

                numeric nScreen, nDiscount
                     character cType


                    Accept cType
                    Accept nScreen

                           Is          Yes
                       cType=‘B’?                        nDiscount=5% of SP

                                No

                            Is       Yes            Is          Yes
                                                                              nDiscount=8% of SP
                        cType=‘C’?              nScreen=14?

                             No                          No

                                                    Is          Yes
                                                                              nDiscount=10% of SP
                                                nScreen=21?

                                                         No

                         Stop

     Ver. 1.0                                Session 2                                       Slide 26 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation




                           Exercises



     Ver. 1.0                Session 2                    Slide 27 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 1


                Study the given flowchart and answer the following
                questions.
                                                 Start
                What will be the output when:
                   nNum=7                        numeric nNum

                   nNum=3                        Accept nNum
                   nNum=11
                                                      Is        Yes
                                                   nNum>10?           Display “ GOOD”

                                                        No

                                                     Is         Yes
                                                   nNum>5?             Display “OK”

                                                        No

                                                Display “REJECT”


                                                     Stop

     Ver. 1.0                       Session 2                                 Slide 28 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 2


                Study the flowchart and answer the following questions.
                              Start

                          numeric nX, nY


                            Accept nX


                           Accept nY


                               Is          Yes            Is        Yes
                                                       nX > 100 ?         Display “ GOOD”
                            nX > nY ?

                                 No                          No
                               Is          No
                            nY > 100 ?

                                 Yes
                            Display nY


                              Stop

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


                What will be the output when:
                   nX=150 and nY=75
                   nX=90 and nY=50
                   nX=40 and nY=80




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


                Draw a flowchart to accept a number and then find out
                whether or not the number is divisible by 5.




     Ver. 1.0                       Session 2                       Slide 31 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 4


                Draw a flowchart to accept three numbers and display the
                largest number.




     Ver. 1.0                       Session 2                       Slide 32 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Exercise 5


                Candidates have to enter their age. The age cannot be
                negative. If a negative age is entered, an error message
                has to be displayed, otherwise the age is displayed.
                Represent the error checking logic for this situation using a
                flowchart.




     Ver. 1.0                        Session 2                          Slide 33 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Summary


                In this session, you learned that:
                   Data can be categorized as a constant or variable.
                   Data types can be:
                     • Numeric
                     • Character
                   The operators are:
                     • Arithmetic
                     • Relational
                     • Logical
                 – Arithmetic operators are used to perform arithmetic
                   calculations. The symbols that represents arithmetic operations
                   are called arithmetic operators (*,/,+,-,%).




     Ver. 1.0                           Session 2                          Slide 34 of 35
Installing WindowsLogic and Techniques
Programming XP Professional Using Attended Installation
Summary (Contd.)


                – Relational operators are used to test the relationship between
                  two variables. The symbols that represent relational operations
                  are called relational operators (<,>,=,!=).
                – Logical operators (AND, OR, NOT) are used to combine
                  expressions containing relational operators.
                – The decision box is used to apply conditions by asking a
                  question in a flowchart.




     Ver. 1.0                         Session 2                           Slide 35 of 35

More Related Content

What's hot

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
Niit 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_10
Niit Care
 
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
Niit 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_16
Niit 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_05
Niit 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_19
Niit Care
 
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
Niit 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_11
Niit 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_01
Niit Care
 
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
Niit Care
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
Niit Care
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature Implementations
Shinpei Hayashi
 
Java Programming Assignment
Java Programming AssignmentJava Programming Assignment
Java Programming Assignment
Vijayananda Mohire
 
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Shinpei Hayashi
 
Guiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature LocationGuiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature Location
Shinpei Hayashi
 
Visualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored MapVisualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored Map
Takanori Ugai
 
4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using uml
APU
 
Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...
Shinpei Hayashi
 
ASE02.ppt
ASE02.pptASE02.ppt
ASE02.ppt
Ptidej Team
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
Maria Joslin
 

What's hot (20)

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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature Implementations
 
Java Programming Assignment
Java Programming AssignmentJava Programming Assignment
Java Programming Assignment
 
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
Recording Finer-Grained Software Evolution with IDE: An Annotation-Based Appr...
 
Guiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature LocationGuiding Identification of Missing Scenarios for Dynamic Feature Location
Guiding Identification of Missing Scenarios for Dynamic Feature Location
 
Visualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored MapVisualizing Stakeholder Concerns with Anchored Map
Visualizing Stakeholder Concerns with Anchored Map
 
4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using uml
 
Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...Toward Understanding How Developers Recognize Features in Source Code from De...
Toward Understanding How Developers Recognize Features in Source Code from De...
 
ASE02.ppt
ASE02.pptASE02.ppt
ASE02.ppt
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
 

Viewers also liked

02 t1 s2_linux_lesson2
02 t1 s2_linux_lesson202 t1 s2_linux_lesson2
02 t1 s2_linux_lesson2
Niit Care
 
Sql xp 09
Sql xp 09Sql xp 09
Sql xp 09
Niit Care
 
Sql xp 11
Sql xp 11Sql xp 11
Sql xp 11
Niit Care
 
Sql xp 10
Sql xp 10Sql xp 10
Sql xp 10
Niit Care
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
Niit Care
 
Sql xp 01
Sql xp 01Sql xp 01
Sql xp 01
Niit Care
 
Comp tia n+_session_08
Comp tia n+_session_08Comp tia n+_session_08
Comp tia n+_session_08
Niit Care
 
SQL | Computer Science
SQL | Computer ScienceSQL | Computer Science
SQL | Computer Science
Transweb Global Inc
 
MS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTUREMS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTURE
Douglas Bernardini
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
VishalJharwade
 
Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
Niit Care
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
Ajeet Singh
 

Viewers also liked (12)

02 t1 s2_linux_lesson2
02 t1 s2_linux_lesson202 t1 s2_linux_lesson2
02 t1 s2_linux_lesson2
 
Sql xp 09
Sql xp 09Sql xp 09
Sql xp 09
 
Sql xp 11
Sql xp 11Sql xp 11
Sql xp 11
 
Sql xp 10
Sql xp 10Sql xp 10
Sql xp 10
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Sql xp 01
Sql xp 01Sql xp 01
Sql xp 01
 
Comp tia n+_session_08
Comp tia n+_session_08Comp tia n+_session_08
Comp tia n+_session_08
 
SQL | Computer Science
SQL | Computer ScienceSQL | Computer Science
SQL | Computer Science
 
MS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTUREMS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTURE
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 

Similar to 02 iec t1_s1_plt_session_02

05 intel v_tune_session_07
05 intel v_tune_session_0705 intel v_tune_session_07
05 intel v_tune_session_07
Niit Care
 
Assembler (2)
Assembler (2)Assembler (2)
Assembler (2)
Vaibhav Bajaj
 
RNN sharing at Trend Micro
RNN sharing at Trend MicroRNN sharing at Trend Micro
RNN sharing at Trend Micro
Chun Hao Wang
 
Ch 3 Assembler in System programming
Ch 3 Assembler in System programming Ch 3 Assembler in System programming
Ch 3 Assembler in System programming
Bhatt Balkrishna
 
Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1 Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1
To Sum It Up
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
Niit Care
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
Student
 
Nodejs Session01
Nodejs Session01Nodejs Session01
Nodejs Session01
Jainul Musani
 
Input output
Input outputInput output
Input output
nicky_walters
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
Vivek chan
 
Java session01
Java session01Java session01
Java session01
Niit Care
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
Clemens Reijnen
 
Input output
Input outputInput output
Input output
nicky_walters
 
Using Show Commands to Investigate Network Status Lab Grading Ru.docx
Using Show Commands to Investigate Network Status Lab Grading Ru.docxUsing Show Commands to Investigate Network Status Lab Grading Ru.docx
Using Show Commands to Investigate Network Status Lab Grading Ru.docx
dickonsondorris
 
Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course
Kernel Training
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
Oswald Campesato
 
Matlab 3
Matlab 3Matlab 3
Matlab 3
asguna
 
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
Lecture # 1 - Introduction  Revision - 1 OOPS.pptxLecture # 1 - Introduction  Revision - 1 OOPS.pptx
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
SanaullahAttariQadri
 
Chapter 01.PPT
Chapter 01.PPTChapter 01.PPT
Chapter 01.PPT
JoeBlack136
 
Introduction to java 101
Introduction to java 101Introduction to java 101
Introduction to java 101
kankemwa Ishaku
 

Similar to 02 iec t1_s1_plt_session_02 (20)

05 intel v_tune_session_07
05 intel v_tune_session_0705 intel v_tune_session_07
05 intel v_tune_session_07
 
Assembler (2)
Assembler (2)Assembler (2)
Assembler (2)
 
RNN sharing at Trend Micro
RNN sharing at Trend MicroRNN sharing at Trend Micro
RNN sharing at Trend Micro
 
Ch 3 Assembler in System programming
Ch 3 Assembler in System programming Ch 3 Assembler in System programming
Ch 3 Assembler in System programming
 
Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1 Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
Nodejs Session01
Nodejs Session01Nodejs Session01
Nodejs Session01
 
Input output
Input outputInput output
Input output
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
 
Java session01
Java session01Java session01
Java session01
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
 
Input output
Input outputInput output
Input output
 
Using Show Commands to Investigate Network Status Lab Grading Ru.docx
Using Show Commands to Investigate Network Status Lab Grading Ru.docxUsing Show Commands to Investigate Network Status Lab Grading Ru.docx
Using Show Commands to Investigate Network Status Lab Grading Ru.docx
 
Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course
 
Deep Learning and TensorFlow
Deep Learning and TensorFlowDeep Learning and TensorFlow
Deep Learning and TensorFlow
 
Matlab 3
Matlab 3Matlab 3
Matlab 3
 
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
Lecture # 1 - Introduction  Revision - 1 OOPS.pptxLecture # 1 - Introduction  Revision - 1 OOPS.pptx
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
 
Chapter 01.PPT
Chapter 01.PPTChapter 01.PPT
Chapter 01.PPT
 
Introduction to java 101
Introduction to java 101Introduction to java 101
Introduction to java 101
 

More from Niit Care

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

More from Niit Care (20)

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 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 

Recently uploaded

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 

Recently uploaded (20)

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 

02 iec t1_s1_plt_session_02

  • 1. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Objectives In this session, you will learn to: Identify variables and constants Use data types Use operators Represent decisions in a flowchart Ver. 1.0 Session 2 Slide 1 of 35
  • 2. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Variables and Constants Example: Flowchart to display the sum of two numbers Start Accept the First Number Accept the Second Number Add the two Numbers and Store the Result Display the Result Stop Ver. 1.0 Session 2 Slide 2 of 35
  • 3. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Variables and Constants (Contd.) The internal memory consists of different locations in which data is stored. A computer needs to identify the memory locations to be able to retrieve values from or store values in them. The value of a variable changes each time the set of instructions is executed. Ver. 1.0 Session 2 Slide 3 of 35
  • 4. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Variables and Constants (Contd.) The values stored in the variables are known as constants. Constants 10 15 25 nNum1 nNum2 nSum Variables Ver. 1.0 Session 2 Slide 4 of 35
  • 5. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Variables and Constants (Contd.) Example: Flowchart to display the sum of two numbers using variables Start Accept nNum1 Accept nNum2 nSum = nNum1 + nNum2 Display nSum Stop Ver. 1.0 Session 2 Slide 5 of 35
  • 6. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Just a minute Each day, the courier service delivers some letters. The number of letters is different each day. Regardless of the number of letters delivered by the courier service, they are paid a carrying charge of $5. Identify the variable and constant data in this situation. Variable: Constant: Answer: Variable: Number of letters Constant: Carrying charge $5 Ver. 1.0 Session 2 Slide 6 of 35
  • 7. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Just a minute Identify the variables and constants from the following list: 1. Age 2. Address 3. 21 4. “10, Kingsway Camp” 5. “Henri” 6. Name 7. “185” Answer: Constants: 21, “10, Kingsway Camp”, “Henri”, “185” Variables: Age, Address, Name Ver. 1.0 Session 2 Slide 7 of 35
  • 8. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Numeric Numeric variables can contain only numbers. These variables can be used in arithmetic operations. Ver. 1.0 Session 2 Slide 8 of 35
  • 9. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Character Character variables can contain any combination of letters, numbers, and special characters. These variables cannot be used for calculation. Ver. 1.0 Session 2 Slide 9 of 35
  • 10. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Declaring Variables Example: Start numeric nNum1, Declaration nNum2, nSum of Variables Accept nNum1 Accept nNum2 nSum = nNum1 + nNum2 Display nSum Stop Ver. 1.0 Session 2 Slide 10 of 35
  • 11. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Variable Naming Conventions The first letter of the variable may indicate the data type used. The variable name should clearly describe its purpose. In case of multiple words, the first letter of each word could be capitalized for better readability. Ver. 1.0 Session 2 Slide 11 of 35
  • 12. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Using Operators Operators are symbols for some predefined operations. The operators that are used in flowcharts are: Arithmetic operators Relational operators Logical operators Ver. 1.0 Session 2 Slide 12 of 35
  • 13. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Arithmetic Operators Arithmetic operators are used to perform arithmetic calculations. The symbols that represent arithmetic operations are called arithmetic operators (*, /, +, -, %). Ver. 1.0 Session 2 Slide 13 of 35
  • 14. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Relational Operators Relational operators are used to test the relationship between two variables or the relationship between a variable and a constant. There are six relational operators (=,>,<,!=,>=,<=). Ver. 1.0 Session 2 Slide 14 of 35
  • 15. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Logical Operators Logical operators (AND, OR, NOT) are used to combine expressions containing relational operators: nNum1 = 7 AND nNum2 > 5 nNum1 = 7 OR nNum2 > 5 NOT nNum2 <= 5 The order of precedence for the execution of logical operators is NOT, AND, and OR. Ver. 1.0 Session 2 Slide 15 of 35
  • 16. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Just a minute Draw a flowchart to accept item name, price, and quantity. You need to calculate the value as the product of price and quantity, and display the calculated value and the item name using variables. Ver. 1.0 Session 2 Slide 16 of 35
  • 17. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Just a minute (Contd.) Answer: Start character cltemName numeric nPrice, nQuantity, nValue Accept cItemName Accept nPrice Accept nQuantity nValue = nPrice * nQuantity Display cItemName, nValue Stop Ver. 1.0 Session 2 Slide 17 of 35
  • 18. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart Many problems require decisions to be made. All decisions may or may not state an action to be taken if the condition is false. Following is a flowchart segment to compare two numbers and check for equality. Is nNum1 = No nNum2 ? Yes Display “The Display “The numbers are numbers are equal” not equal” Ver. 1.0 Session 2 Slide 18 of 35
  • 19. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Example: Accept two numbers and print the larger of the two numbers Start numeric nNum1, nNum2 Accept nNum1 Accept nNum2 A Ver. 1.0 Session 2 Slide 19 of 35
  • 20. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Example (Contd.): A Is Yes Display “ The nNum1=nNum2? numbers are equal” No Is Yes nNum1>nNum2? Display nNum1 No Display nNum2 Stop Ver. 1.0 Session 2 Slide 20 of 35
  • 21. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Example: Print the value of nX only if the value of nX is greater than 10 and nX is an even number Start numeric nX Accept nX Is No nX>10 AND nX%2=0? Yes Display nX Stop Ver. 1.0 Session 2 Slide 21 of 35
  • 22. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Example: Accept the year and then determine whether the year is a leap year or not. A leap year is one that is divisible by 4, other than a century year, such as 1900. A century year, which is divisible by 400, such as 2000, is also a leap year. To evaluate the given condition, we can interpret this as: • If year is divisible by 4 AND not divisible by 100 OR divisible by 400, it is a leap year. Ver. 1.0 Session 2 Slide 22 of 35
  • 23. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Flowchart to determine a leap year Start numeric nYear Display “Please enter a year” Accept nYear A Ver. 1.0 Session 2 Slide 23 of 35
  • 24. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Flowchart to determine a leap year (Contd.) A Is nYear % 4=0 AND No Display “This is (nYear % 100 !=0 OR nYear % 400=0) ? not a leap year” Yes Display “This is a leap year” Stop Ver. 1.0 Session 2 Slide 24 of 35
  • 25. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Example: To decide about the discount percentage on a TV, the sales person needs to check the type of TV. If the TV is Black and White [B], the discount will be 5 percent of the selling price. If the type of TV is colored[C], then he has to verify the size of TV screen. For 14 inches screen, discount is 8 percent of the selling price and for 21 inches screen, the discount is 10 percent of the selling price. Ver. 1.0 Session 2 Slide 25 of 35
  • 26. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Representing Decisions in a Flowchart (Contd.) Flowchart to calculate discount Start numeric nScreen, nDiscount character cType Accept cType Accept nScreen Is Yes cType=‘B’? nDiscount=5% of SP No Is Yes Is Yes nDiscount=8% of SP cType=‘C’? nScreen=14? No No Is Yes nDiscount=10% of SP nScreen=21? No Stop Ver. 1.0 Session 2 Slide 26 of 35
  • 27. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercises Ver. 1.0 Session 2 Slide 27 of 35
  • 28. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 1 Study the given flowchart and answer the following questions. Start What will be the output when: nNum=7 numeric nNum nNum=3 Accept nNum nNum=11 Is Yes nNum>10? Display “ GOOD” No Is Yes nNum>5? Display “OK” No Display “REJECT” Stop Ver. 1.0 Session 2 Slide 28 of 35
  • 29. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 2 Study the flowchart and answer the following questions. Start numeric nX, nY Accept nX Accept nY Is Yes Is Yes nX > 100 ? Display “ GOOD” nX > nY ? No No Is No nY > 100 ? Yes Display nY Stop Ver. 1.0 Session 2 Slide 29 of 35
  • 30. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 2 (Contd.) What will be the output when: nX=150 and nY=75 nX=90 and nY=50 nX=40 and nY=80 Ver. 1.0 Session 2 Slide 30 of 35
  • 31. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 3 Draw a flowchart to accept a number and then find out whether or not the number is divisible by 5. Ver. 1.0 Session 2 Slide 31 of 35
  • 32. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 4 Draw a flowchart to accept three numbers and display the largest number. Ver. 1.0 Session 2 Slide 32 of 35
  • 33. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Exercise 5 Candidates have to enter their age. The age cannot be negative. If a negative age is entered, an error message has to be displayed, otherwise the age is displayed. Represent the error checking logic for this situation using a flowchart. Ver. 1.0 Session 2 Slide 33 of 35
  • 34. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Summary In this session, you learned that: Data can be categorized as a constant or variable. Data types can be: • Numeric • Character The operators are: • Arithmetic • Relational • Logical – Arithmetic operators are used to perform arithmetic calculations. The symbols that represents arithmetic operations are called arithmetic operators (*,/,+,-,%). Ver. 1.0 Session 2 Slide 34 of 35
  • 35. Installing WindowsLogic and Techniques Programming XP Professional Using Attended Installation Summary (Contd.) – Relational operators are used to test the relationship between two variables. The symbols that represent relational operations are called relational operators (<,>,=,!=). – Logical operators (AND, OR, NOT) are used to combine expressions containing relational operators. – The decision box is used to apply conditions by asking a question in a flowchart. Ver. 1.0 Session 2 Slide 35 of 35