Self Practise Topic 2

Self Practise Topic 2

Varibles & Datatypes Area

  1. 1)Create an Integer Item named mynum and store the value 100 and diplay the data in a Message Box when the page run.
  2. 2) Create a program to add two decimal numbers and display the result in a Message box when the object run.

Answers:

2.1)Here i am not specifying how to define a variable, i think you already understand how to define that from the previous post. Only diff is that you have to define the variable in the Datatype column as integer. 

The program code for display that was

----------------------------------------------------------- 

mynum := 5;

MESSAGE('The Value Of %1 Is %2', 'mynum', mynum);

-----------------------------------------------------------

2.2) For doing this you have todefine 2 variables as Decimal numbers.

Let us consider Num1 and Num2 , the result storing and display from the Result variable

the programming codes are as follows

----------------------------------------------------------

Num1 := 2;

Num2 := 7;

Result := Num1 + Num2;

MESSAGE('The Value Of %1 Is %2', 'Result', Result);

----------------------------------------------------------

The result will be 9

Related Posts with Thumbnails