Ada is a structured, statically typed, imperative, wide- spectrum, and object-oriented high-level computer programming language, extended from Pascal.

Slides:



Advertisements
Similar presentations
Programming Paradigms and languages
Advertisements

Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Chapter 3 DATA: TYPES, CLASSES, AND OBJECTS. Chapter 3 Data Abstraction Abstract data types allow you to work with data without concern for how the data.
Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
CIS 101: Computer Programming and Problem Solving Lecture 8 Usman Roshan Department of Computer Science NJIT.
High-Level Programming Languages
Chapter 8 High-Level Programming Languages Nell Dale John Lewis.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
1 Data types, operations, and expressions Overview l Format of a Java Application l Primitive Data Types l Variable Declaration l Arithmetic Operations.
CS241 PASCAL I - Control Structures1 PASCAL I - Control Structures Philip Fees CS241.
Hello, world! Dissect HelloWorld.java Compile it Run it.
String Escape Sequences
C++ Functions. 2 Agenda What is a function? What is a function? Types of C++ functions: Types of C++ functions: Standard functions Standard functions.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
Elements of a C++ program 1. Review Algorithms describe how to solve a problem Structured English (pseudo-code) Programs form that can be translated into.
Input & Output: Console
ITEC 320 Procedural Programming Dr. Ray Lecture 1.
C-Language Keywords(C99)
Slide: 1 Copyright © AdaCore Basic Types Presented by Quentin Ochem university.adacore.com.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
ITEC 320 Lecture 5 Scope Exceptions. Scope / Exceptions Review Functions Procedures.
Java ProgrammingtMyn1 Java Programming Timo Mynttinen Mikkeli University of Applied Sciences.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Lec 6 Data types. Variable: Its data object that is defined and named by the programmer explicitly in a program. Data Types: It’s a class of Dos together.
Lecture #5 Introduction to C++
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Java Simple Types CSIS 3701: Advanced Object Oriented Programming.
 Character set is a set of valid characters that a language can recognise.  A character represents any letter, digit or any other sign  Java uses the.
Higher Grade Computing Studies 3. High Level Language Constructs Higher Computing Software Development S. McCrossan 1 Simple Data Types Integer: An integer.
Chap 7- Control Structures : The WHILE Statement.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
ISBN Chapter 6 Data Types Introduction Primitive Data Types User-Defined Ordinal Types.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Copyright Curt Hill Variables What are they? Why do we need them?
Review With packagename ; Use packagename ; Procedure procedurename Is declaration of variables & constants Begin statements of program End procedurename.
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
Chapter 8 High-Level Programming Languages. 2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Slide: 1 Copyright © AdaCore Your First Ada Program Presented by Quentin Ochem University.adacore.com.
CS 153: Concepts of Compiler Design September 30 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
CSI 3125, Preliminaries, page 1 Data Type, Variables.
CPS120: Introduction to Computer Science Variables and Constants.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 06 – Java Datatypes Webpage:
JAVA Programming (Session 2) “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
structured statically typed imperative wide-spectrum object-oriented high-level computer programming language extended from Pascal and other languages.
小型系統 心情 vs. 古典樂 心情 vs. 古典樂 浪漫求籤系統 美食導航系統 季潔亭雅鈺熒岱芸 美食導航系統 楊氏音樂模擬大會考人瑋 若維 芷萱 伽倩 楊氏音樂模擬大會考 麥當勞熱量計算系統 火星文困擾你嗎 ? 火星文困擾你嗎 ? 歌詞知多少 - 挑戰你的腦容量英琪 日馨 青雪 鈺娟.
C LANGUAGE MULITPLE CHOICE QUESTION SET-2
Key Words / Reserved Words
Definition of the Programming Language CPRL
Chapter Topics The Basics of a C++ Program Data Types
Objects as a programming concept
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
Type Checking Generalizes the concept of operands and operators to include subprograms and assignments Type checking is the activity of ensuring that the.
Wel come.
by Dharani Pullammagari
Lecture 16: Introduction to Data Types
Basic Elements of C++.
C++, OBJECT ORIENTED PROGRAMMING
Basic Elements of C++ Chapter 2.
Basics of ‘C’.
High Level Programming Languages
Low Level Programming Languages
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
C# Revision Cards Data types
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
COMPUTING.
Presentation transcript:

Ada is a structured, statically typed, imperative, wide- spectrum, and object-oriented high-level computer programming language, extended from Pascal and other language created in the 1970 for the purpose of the US Department of defense this decision because they had realized that there were many languages used by the US Department of Defense and created this program to supersede the many different languages they were using

named after the first credited programmer Ada Lovelace the US Department of Defense was concerned by the number of different programming languages being used for its embedded computer system projects, many of which were obsolete or hardware-dependent, and none of which supported safe modular programming

Data types of a programming language are the different types of input and symbols that a programming language can read and work with

TypeRange Integer-2,147,483,648 to 2,147,483,647 Natural0 to Integer'last Positive1 to Integer'last Long_Integer-2**63 to (2**63)-1 Short_Integer-128 to 127 Float, Short_Float Real numbers with an approximate range of 8.43E-37 to 3.37E+38 and an accuracy of about 6 decimal digits Long_FloatReal numbers with an approximate range of 4.19E-307 to 1.67E+308 and an accuracy of about 15 decimal digits BooleanAn enumeration type with the values (False, True) CharacterA character in the ANSI (8-bit) character set. Wide_CharacterA character in the UNICODE (16-bit) character set Unsigned_Integer0 to 4,294,967,295 Byte_IntegerInteger values in the range of -128 to 127 Unsigned_Byte_IntegerInteger values in the range of 0 to 255 Word_IntegerInteger values in the range of to Unsigned_Word_IntegerInteger values in the range of 0 to Dword_IntegerInteger values in the range of -2,147,483,648 to 2,147,483,647 Unsigned_Dword_IntegerInteger values in the range of 0 to 4,294,967,295 Qword_Integer-2**63 to (2**63)-1 Byte_BooleanAn enumeration type with the values (False, True) Word_BooleanAn enumeration type with the values (False, True) Dword_BooleanAn enumeration type with the values (False, True). Useful when interfacing with C code.

Characternext_vowel := ‘o’; Floatdelta_v_sq := (v2-v1) **2; Delta_sum := (delta_v_sq + delta_h_sq) *.10; angle := 2.0 * pi * float(p) / 360.0; integeri := i + 1; naturalnew_value := abs(any_value) + mod(old_value, 10); string my_string := “ “ & packname(j) & “-“;

with Ada.Text_IO, ADa.Integer_Text_IO; use Ada.Text_IO, Ada.Integer_Text_IO; procedure Example is Year : INTEGER; begin for Age in loop Put("In"); Put(Age ,5); Put(", I was"); Put(Age,3); Put(" years old"); case Age is when 5 => Put(", and started school"); when 17 => Put(", and graduated from high school"); when others => null; end case; Put("."); New_Line; end loop; end Example;

Parameter ModeFunctionsProcedureDescription INYes Passed into the subprogram, are constants in the subprogram, and may not be changed in the subprogram OUTNoYesPassed out of the subprogram, a parameters value is defined inside the subprogram INOUTNoYesPassed into the subprogram, and may be changed by the subprogram, and the parameters value is passed out of the subprogram

Although the Ada language primary use was for the US Department of Defense, it does support object oriented programming It does have use interface with buttons, images, audio, and other source of input

Concurrent computation makes programming much more complex major feature of the Ada programming language is the facilities it provides for concurrent programming

begin... exception when Buffer_Full_Error => Reset_Buffer; when Error: others => Put_Line("Unexpected exception raised:"); Put_Line(Ada.Exceptions.Exception_Information(Error)); end;

HELLO WORLD! -- Ada Hello, World! program. with Text_IO; use Text_IO; procedure Hello is Put_Line("Hello, World!"); end Hello;

Function: with Gnat.Io; use Gnat.Io; procedure f1 is -- A small function. function Sumsqr(X, Y: Integer) return Integer is begin return X*X + Y*Y; end; -- How 'bout a nice, tender variable? I: Integer; begin I := Sumsqr(3, 14); Put(I); New_Line; Put(Sumsqr(I, 4)); New_Line; end f1;

with Ada.Text_IO; use Ada.Text_IO; procedure ReadOut is S: String(1..100); -- Input line (up to 100 chars) N: Integer; -- Number of characters read. Begin -- Issue the lovely decoration. Put_Line(" " & " "); -- Copy lines like there's no tomorrow. loop Get_Line(S, N); Put_Line(S(1..N)); end loop; exception when End_Error => -- When reaching end of file, issue the closing lovely decoration and -- return from the procedure. Put_Line(" " & " "); return; end ReadOut;