Presentation is loading. Please wait.

Presentation is loading. Please wait.

by Dharani Pullammagari

Similar presentations


Presentation on theme: "by Dharani Pullammagari"— Presentation transcript:

1 by Dharani Pullammagari
ADA Programming Language by Dharani Pullammagari

2 History Ada was originally designed by a team led by Jean Ichbiah of CII Honeywell Bull under contract to the United States Department of Defense (DoD) from 1977 to 1983. -> Ada 95, was the first internationally standardized (ISO) Object-Oriented Language. -> Ada was named after Ada Lovelace (1815–1852)from England, who has been credited with being the first computer programmer.

3

4 Versions Ada 83/Ada 87: Jean Ichbiah, the language became ANSI standard in1983 and without any changes became an ISO standard in 1987. Ada 95: Tucker Taft (since it became ISO standard object-oriented programming language in February 1995) Ada 2005: Tucker Taft Ada 2012: Tucker Taft(is the most recent stable release on february 2016)

5 PARADIGM Ada is a multiparadigm language
Structured, is a programming paradigm aimed at improving the clarity, quality, Statistically typed, The main purpose of a type system is to reduce possibilities for bugs wide spectrum, is used as both high level language and low level language imperative, Object oriented, is based on obejcts

6 Compilers DACS : DDC-I Inc. (is a privately held company) established a business in selling the Ada compiler system. GREEN HILLS SOFTWARE OPTIMISING ADA 95 COMPILER ADACORE GNAT: GNAT is a free-software compiler for the Ada programming language. It supports all versions of the language, i.e. Ada 2012, Ada 2005, Ada 95 and Ada 83

7 Applications Avionics:  electronic systems(communication, navigation, display of multiple systems) used on aircraft, artificial satellites, and spacecraft. Banking Military Railways: metro sub trains in Paris, London, and New York.(cab signaling) Air traffic control Boeing 777 Canadian automated air traffic system

8 Program Structure EXAMPLE: with Ada.Text_IO; use Ada.Text_IO;
procedure Form is begin Put("There is no- "); Put("Bad Religion"); New_Line; Put("There are only- "); Put("Bad People"); end Form;

9 There is no- Bad Religion There are only- Bad People.
-- Result of execution There is no- Bad Religion There are only- Bad People. The program outline can be given as follows; procedure <program name> is <declarative part> begin <executable part> end <optional repeat of program name>;

10  There are two portions of any Ada program, a declarative part, which is contained between the reserved words “is” and “begin”, and the executable part between “begin” and “end”.

11 Data Types There are four different kinds of data types syntax:
variableName : DataType;

12 Enumeration Type primitive data types example: i: Integer :=2;
type DAY is (MON,TUE,WED,THU,FRI,SAT,SUN);

13 Modular integer: cannot store a negative number
example: A : = A mod 10 Aggregate types: (gather the components of the data type together into a single type known as a record type) type Date_Type is record Day : Day_Type; Month : Month_Type; Year : Year_Type; end record;

14 Given this type declaration, variables of type Date_Type can be
declared just like variables of any other data type: Now, Later : Date Type;  The variables Later and Now each contain three distinct sub variables.

15 SEQUENCE CONTROL If statements Case statements Simple Loops
case expression is when choices => statements . . . when others => statements end case; Simple Loops While Loops

16 For Loops Exit and exit when: for index in range loop statements
end loop; for i in loop put (i); Exit and exit when: loop if boolean expression then exit; end if; exit when boolean expression;

17 INPUT OUTPUT Text_IO: Text I/O is most used input/output package. All the data inside the file are very readable text Direct_IO:Direct I/O is used for random access files which contain only elements of one specific type. Sequential_IO: With Sequential IO it is the other way round: you can choose between definite and indefinite element types but you have to read and write the elements one after the other.

18 Stream_IO:Stream I/O allows you to mix objects from different element types in one sequential file
Any file in Ada can be used as input or output file but not both.

19 SUB PROGRAM CONTROL There are two distinct categories of subprograms, procedures and functions. Sematic models: in mode: They can receive data from corresponding actual parameters. out mode: They can transmit data to the actual parameter. inout mode: They can do both.

20

21 ENCAPSULATION Making information inaccessible to others who should not use it is called encapsulation. Encapsulation improves a program's maintainability and reliability. The unit of encapsulation in Ada is package that defines a tagged type Every object in a tagged type includes a tag to indicate during execution Tagged types can be private or record type.

22 Inheritance: Subclasses can be derived from tagged types
New entities are added to the inherited entities All subclasses are sub types Ada doesn’t support multiple inheritance. type PERSON is tagged private;

23 SAMPLE PROGRAM with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure jdoodle is X: Natural := 10; Y: Natural := 25; Z: Natural := X + Y;begin Put("X + Y = "); Put(Z); end jdoodle;

24

25


Download ppt "by Dharani Pullammagari"

Similar presentations


Ads by Google