Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

The Spider Adventure-Computer Programming For Aeronautical Engineering And Sciences-Lecture Slides, Slides of Aeronautical Engineering

Prof. Balamohan Pawar delivered this lecture at Allahabad University for Aeronautical Engineering and Computer Programming course. Its main points are: Spider, Adventure, Programming, Semantic, Information, Package, Call, Class, Binder, Ada, Tester

Typology: Slides

2011/2012

Uploaded on 07/20/2012

savitha_48
savitha_48 🇮🇳

3

(1)

120 documents

1 / 4

Related documents


Partial preview of the text

Download The Spider Adventure-Computer Programming For Aeronautical Engineering And Sciences-Lecture Slides and more Slides Aeronautical Engineering in PDF only on Docsity! Lecture C2: The Spider Adventure Response to 'Muddiest Part of the Lecture Cards' (63 respondents) 1) Not sure what we will do for homework in this class? (1 student) Homework are/will be published under the "homework" link on the unified course web page. There will be a few specific exercises based on every lecture in CP. 2) Need more information on how to call packages, what syntax to use for Ada constructs, is Ada case sensitive, … ? (and similar questions) (7 students) The fall term has 17 CP lectures. More or less all of them will introduce new Ada constructs and/or show Ada code. The first two lectures of CP, C1 and C2, have been of an introductory sort, showing you examples rather than the exact details. Starting with lecture C3, we will take it step by step with all the details, and I will tell you more than you ever wanted to know about Ada :) There is something called the Ada Style Guide, it can for example be found via the following link. The style guide is divided into sections that map to the major decisions that each programmer must make when creating high-quality, reliable, reusable, and portable Ada software. Some overlap exists in the sections because not all programming decisions can be made independently. 3) In the Hello_Semantic example, if numbers had been placed within quotation marks, would the program have worked? (1 student) Yes, it would then have produced the output: 12345We hope you enjoy studying Ada Another way could have been to include the following context clause: with Ada.Integer_Text_Io; and change the Put statement to be: Ada.Integer_Text_IO.Put(Item => 12345); The result would have been very similar to the one shown above. 4) Why does the spider program run so slowly? (1 student) Spider runs slowly because of the way both the screen and spider packages are defined. We will come back and revisit the call flow in spider when we talk about packages in detail. 5) What is difference between a procedure and a function? (1 student) Functions can only accept inputs and generate a single output. Procedures on the other hand can both accept inputs and generate multiple outputs. 6) What keys do we use to produce a list file? (1 student) docsity.com Alt + F2, or via menu Compile --> Compile to Listing in AdaGIDE. 7) What was the first file shown for the spider program? (1 student) That was the specification for the Spider package. Name of file is spider.ads 8) What other languages will we use other than Ada? (1 student) You will use Ada 95 and a machine language, which is presented in Appendix C in the Brookshear book. 9) What are debugging techniques for run-time and logic errors? (1 person) Run-time errors are typically caught by adding exception handling to your code. Logic errors on the other hand are caught by means of 1) code reviews during development; 2) testing the code once it has been developed. 10) What is, and how is a FOR LOOP used? (and similar loop questions) (6 students) Different loop constructs will in detail be covered in lectures 4, 10 and 11. 11) Where do we find out which commands a package contains? (and other package questions) (6 students) Use a text editor of your choice, or the AdaGIDE tool to open the files filenam.ads and filename.adb. An Ada package is divided into two parts; the interface/specification (filename.ads), which can be seen as a 'table of contents' for the set of resources the package provides. The other part of a package is the implementation/body (filename.adb), which contains the actual code segments for all the operations in the package. For example a statement like "Spider.Step;" as shown in the examples shown in class means that we want to execute the procedure Step that is available via the Spider package. Don’t forget that for us to be able to use routines from a package we need to include the context clause “WITH Spider;” in the beginning of our application/implementation. Take a look in files Spider.ads and Spider.adb for exact details. -- Following four lines are copied from spider.ads The details of procedure -- step can be found in spider.adb PROCEDURE Step; -- Precondition: None -- Postcondition: Spider takes one step forward in the direction it is facing. -- Raises: Hit_the_Wall if spider tries to step into a wall. Yes, you will later during CP have to write your own packages. A detailed presentation of packages will be given in lecture C9. 12) Is Ada object oriented or procedural? (1 student) docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved