0% found this document useful (0 votes)
13 views45 pages

ITSS-JBC PRG Constructs - Unit2

The document outlines a business plan and training program for ITSS S.A.R.L, focusing on programming concepts such as conditional execution, looping constructs, and modular code. It includes practical exercises for writing programs and debugging, as well as details on using the Design Studio for code compilation and execution. Additionally, it emphasizes the importance of variable management and user input handling in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views45 pages

ITSS-JBC PRG Constructs - Unit2

The document outlines a business plan and training program for ITSS S.A.R.L, focusing on programming concepts such as conditional execution, looping constructs, and modular code. It includes practical exercises for writing programs and debugging, as well as details on using the Design Studio for code compilation and execution. Additionally, it emphasizes the importance of variable management and user input handling in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

YOUR COMPANY

BUSINESS PLAN

A QUALITY PARTER FOR


YOUR
GROWTH

POWERPOINT TEMPLATE

T24 - INDUCTION

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
.
.

Transact Program UNIT-2

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Lesson Overview
➢ Conditional Execution
➢ Looping Constructs
➢ Paragraphs
➢ Editor functionality

.
.

➢ Debug Basic Code

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Conditional Execution – JBC works
▪ What goes inside the BLOCK
▪ PROGRAM BLOCK
▪ Variable
▪ Array
▪ Branching constructs – IF THEN – ELSE, CASE

.
.

▪ Looping constructs LOOP-REPEAT, FOR - NEXT


▪ Comment lines
▪ ….. And more
▪ End

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Conditional Execution – Conditional constructs

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Conditional Execution – Case constructs

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Conditional Execution – Case constructs

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Conditional Execution – Looping constructs
▪ As you all are aware looping construct is a repetitively execution of code
▪ JBC has two looping constructs
▪ FOR . NEXT and
▪ LOOP – REPEAT

▪ FOR … NEXT

.
.

▪ FOR Var = expression 1 TO expression 2


▪ [STEP expression 3 ]
▪ <statements >
▪ <statements>
▪ …..
▪ NEXT Var

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Looping constructs – FOR - NEXT

▪ FOR … NEXT
▪ FOR Var = expression 1 TO expression 2
▪ [STEP expression 3 ]
▪ <statements >

.
.

▪ <statements>
▪ …..
▪ NEXT Var

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Looping constructs – FOR ---NEXT - OUTPUT

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Looping constructs – Looping Construct

LOOP … REPEAT
LOOP
<STATEMENT 1>

.
.

WHILE / UNTIL <Expression>


<STATEMENT 2>
……………………….
REPEAT

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Looping constructs – BREAK and CONTINUE
BREAK is used for early termination on the innermost loop.
CONTINUE statement takes control to the beginning of the Loop

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Paragraphs - Comments

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Paragraphs - Comments

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Paragraphs – Modular code

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Paragraphs – Modular code

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Editor – Functionality

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Debug Basic Code

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Debug View

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Practice

Write a Program to accept the Employee details from the user and display the
value on the screen .
User must input Employee.Name , Employee.Age, Employee.Phno,
Employee.Address, Employee.position

.
.

Developer must use the Modular Approach concepts

What should be done if the Developer does not want to make use of Modular
Approach (alternate way)

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Existing Property file
• Property files are found in the TAFJ_HOME/conf folder
• Choose tafj.properties for this session.

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – properties - precompiled
• Jars Folder refer to the location of the T24 jars.
• As we are using an existing property file, this location is already set

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – properties - Database
• must specify the Database
connection properties
• As we are using an existing property
file, this location is already set.

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Adding a Folder for the program
• right click on the project, click on New-> folder to add a new Basic folder for your
project . .

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Programs in JBC

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Programs in JBC
• Programs begin with keyword PROGRAM and end with END
• CRT is used to display data on the console
• PRINT can also be used for displaying data on console

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Compiling the code

• Ctrl S will save and compile


Result of compilation can be
seen in the console tab

.
• Compilation will create the
.

equivalent .java and .class file

• Alternatively, you can right click


on the program and choose
Compile Basic file

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Execute the Program

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Execute the Program

• Run configuration will be created


for the 1st time when we run the
program.

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Invoking Subroutines in JBC
• A subroutine is a named block of code.
• Subroutines also hold jBC code but, unlike Programs,
• subroutines are not directly executed from the runtime.

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – compiling Subroutines in JBC
• Compilation of subroutine results in ERROR

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – compiling Subroutines in JBC

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – compiling Subroutines in JBC

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Calling the Subroutines

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Invoking a Program
A program can be invoked from another PROGRAM using EXECUTE keyword

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Common Variables

• A variable need not be declared in jBC.

• However, you require a name for the variable and it’s a good practice to
initialize a variable before use.

.
.

• Variables in jBC can store all types of data as well as data of any length.

• They are not declared to be of a specific type.

• Eg CUSTOMER.ID = “A001”, CUSTOMER.ID variable stores a character string

• CUSTOMER.ID = 9278, Here the same CUSTOMER.ID variable now stores a


numeric value.
ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Accept User INPUT
• The INPUT statement allows the program to collect data from the current input
device, which is normally the keyboard
• INPUT Variable Name for example INPUT NAME
• Colon operator is used for concatenation

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Common variables
• The Variables can be created
• Locally within a program / subroutine – Local Variables
• Shareable between programs / subroutines – Common Variables

• Local variables are variables used within the program or subroutine

.
.

• Common variables are variables used outside the program or subroutine within
a session space

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Common variables >> visibility

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Common variables >> Global visibility

.
.

Common variable retains the state across


multiple code blocks and hence act as
session specific variables

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Common variables >> INSERT files

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Common variables >> INSERT files

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Design Studio – Common variables >> Scope

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
Practice

.
.

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM
.
.

Thank You

ITSS S.A.R.L
WWW.ITSSGLOBAL.COM

You might also like