0% found this document useful (0 votes)
3 views

Practice_Example

The document provides a series of practice examples for control flows in a programming context, including activities such as Delay, Assign, If, For Each, While, Do While, and Switch. Each activity includes steps for creating variables, setting conditions, and displaying messages. The examples illustrate how to implement these control flows to perform tasks like counting files, checking even/odd numbers, printing Fibonacci series, and incrementing counters.

Uploaded by

eklure.svl
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Practice_Example

The document provides a series of practice examples for control flows in a programming context, including activities such as Delay, Assign, If, For Each, While, Do While, and Switch. Each activity includes steps for creating variables, setting conditions, and displaying messages. The examples illustrate how to implement these control flows to perform tasks like counting files, checking even/odd numbers, printing Fibonacci series, and incrementing counters.

Uploaded by

eklure.svl
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Practice Examples

Control Flows
Delay Activity
Create a
new
Process
Select
New->
Sequence
Create a
variable
to hold
the name
(Cntrl +k)
Set the
Time
Duration
10
seconds
Assign Activity (Count the number
of files)

Create Assign
Two path to
Variable read the
files
Set the
Assign
Drag drop Property
Assign To and
and Value ->
Message
box
“Number of
files found in
the folder are -
>”+NumberOfFi
les.Count.ToStri
ng
If Activity – Find number is even/odd
Create a
variable
‘number’ by
Add a Input pressing
Dialog Cntrl +k
• Drag an If activity and in the condition section mention number mod 2 = 0. After
that, in the Then section drag a message box and mention number.ToString + ” is
a even number” and in the Else section drag a message box and
mention number.ToString + ” is a odd number”.
For each Activity – Print Fibonacci
Series
• Drag the For Each activity and in the value section mention a
variable ‘numbers’. Now, before you mention the variable here, create a
variable of Int32[] type and in the default value section mention
the Fibonacci series.
• In the Body section of the For Each activity drag a message box and
mention “The length of this Fibonacci sequence = “+
numbers.Length.ToString + ” Contains the element -> ” +
item.ToString.
While Activity- Print number 1 to 10
• Drag the While activity and in the condition section mention
the condition count < 10. But, before that create the
variable count.
• In the Body section of this activity, drag an Assign activity, and assign
the To section to count and the value section to count + 1 function. This will
increase the counter by 1, until the condition is satisfied.
• Drag the Append Line activity and mention the File Name, where you want
to store the Text that you will quote in this activity. Over here, I have
mentioned the Text to be “The counter is now ” + count.ToString +”.”.
Do While Activity
• Step 1: Drag the Do-While activity and condition
section mention the condition count < 10. But, before that
create the variable count.
• Step 2: In the Body section of this activity, drag an Assign
activity, and assign the To section to count and
the value section to count + 1. This will increase the counter by
1, until the condition is satisfied. Refer below.
• Step 3: Drag the Append Line activity and mention the File Name, where
you want to store the Text that you will quote in this activity. Over here, I have
mentioned the Text to be “The counter is now ” + count.ToString
+”.”. Refer below.
Switch Activity
Create a
New
Flowchart

Drag & drop


Input Dialog

Add variable
to result
property :Cn
trl +k
Drag &
drop
Switch
Activity

Drag & drop


message box

You might also like