.

Showing posts with label ada. Show all posts
Showing posts with label ada. Show all posts

Wednesday, April 18, 2012

[Ada] Procedure Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Procedure in Ada programming language. This source code is to show how to do Procedure statement in Ada language. Here's the template:


procedure <ProcedureName>(<input1>,...,<inputN>: in <value-type>;<output1>,...,<outputN>: out <value-type>) is
begin
       <Statement>
end <ProcedureName>;

Note:   <input1>,...,<inputN>: in <value-type>   is optional, only use it if there is input required in the procedure, while <output1>,...,<outputN>: out <value-type> if there is output required in the procedure.

Okay, that's all I can say. Thank you for reading ^^!








[Ada] Function Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Function in Ruby programming language. This source code is to show how to do  Function statement in Ruby language. Here's the template:


function <FunctionName>(<input1>,...,<inputN>:<value-type>) return <value-type> is
begin
       <Statement>
       return <value>;
end <FunctionName>;

Note:  <input1>,...,<inputN>:<value-type>  is optional, only use it if there is input required in the function

Okay, that's all I can say. Thank you for reading ^^!








Tuesday, April 17, 2012

[Ada] Case Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Case in Ada programming language. This source code is to show how to do Case statement in Ada language. Here's the template:



case <variable name> is
   when <variable condition 1> =>
       <statement 1 if variable fulfills condition 1>
   when <variable condition 2> =>
       <statement 2 if variable fulfills condition 2>
   when <variable condition 3> =>
       <statement 3 if variable fulfills condition 3>
   when <variable condition 4> =>
       <statement 4 if variable fulfills condition 4>
   when <variable condition N> =>
       <statement N if variable fulfills condition N>
   when others =>
       <statement if variable doesn't fulfill any condition>
end case;


Note: " when others" is optional


Okay, that's all I can say. Thank you for reading ^^!








Saturday, April 14, 2012

[Ada] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in Ada programming language. This source code is to show how to do If-Then-Else statement in Ada language. Here's the template:


if <condition> then
       <statement if true> 
else
       <statement if false>
end if;


Okay, that's all I can say. Thank you for reading ^^!








[Ada] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in Ada programming language. This source code is to show how to do If-Then statement in Ada language. Here's the template:


if <condition> then
       <statement if true> 
end if;


Okay, that's all I can say. Thank you for reading ^^!





Saturday, November 19, 2011

[Ada] Temperature Converter Listing

          It's been a while since I had my last playing with Ada programming language so today I play with it. This one is similar with [C] Temperature Converter Listing, but it this one is written in Ada programming language. I still beginner with this language but the previous learning of Ada before (but not much) helped me programming this one. Okay, that's all I can say. Thank you for reading ^^!





Extra Credit: