comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Suggestions for topics in an Ada course?
Date: Mon, 12 Nov 2007 11:56:02 GMT
Date: 2007-11-12T11:56:02+00:00	[thread overview]
Message-ID: <mbXZi.17510$if6.631@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 4737291e$0$27064$4d3efbfe@news.sover.net


For Concepts 

  First: Ada Conformity 

  Second: Elaboration

  Third:  The compiling process [ compile / bind / link ]. 
          A. Compiler. Limited command line options. And they 
                       not needed to maintain portability with 
                       other operating environments. Unlike C

            1. No conditional coding. Unlike C

          B. The Bind(er) -- Not used in C.
            0. For your student why is Binding require for Ada 
               code.
            1. Performs consistent checking
            2. Calculates elaboration order.
            3. Determines the object code needed.
            4. Builds a small program that calls the
               Elaboration routines in correct order and 
               then calls main procedure that is the 
               users program then calls finalization 
               routines.

        C. Linker

  Fourth: Built-in constructs that can aid the programmer to create 
          a higher integrity and efficient algorithm in a timely 
          matter. Such as using Attributes and Exceptions for data 
          validation and error checking.

          Example : X'Valid    -- The attribute Valid returns true if 
                                  the value of X is valid for X's 
                                  pre-defined type.


Assignment:
  The following was my first assignment in my Ada class. Given on the 
first day of class. Due Date was 2 weeks. 


Create 5 task: Tasks may be with a single procedure or grouped into
one procedure and two packages. Signals are string that refect the 
action being perform or simulated. 

The following is basic an outline of the operation of the partition.

Package 1

  Task 1: Non functional until started by Task 2
          Obtain a random number every X seconds from a pseudo
                                 random number generator 
                                 function (user created). 
          Transmit each number to Task 3.

  Task 2: Wait until Signaled from task 4
            Startup
              Signal Task 4 that startup command has been received.
              Start Task 1
              Signal Task 4 that Task 1 is operational.
            Shutdown
              Signal Task 4 that shutdown command has been received.
              Preform Task 1 shutdown
              Signal Task 4 that Task 1 has shutdown.
              -- Preform Task 2 shutdown
              Signal Task 4 that Task 2 has shutdown.

Package 2

  Task 3: Operational base on commands from Task 4
          Receive a number from Task 1
          Calculate a Sum of these numbers 
          Transmit the sum to Task 5 every Y seconds.
          Clear and reset Sum



  Task 4: Wait until Signaled from task 5
         Startup
           Signal Task 5 that startup command has been received.
           Signal Task 2 to perform startup
           Retransmit any signals from Task 2 to Task 5
           Start Task 3
           Signal Task 5 that Task 3 is operational.

         Shutdown
           Signal Task 5 that shutdown command has been received.
           Signal Task 2 to perform shutdown
           Retransmit any signals from Task 2 to Task 5
           Preform Task 3 shutdown
           Signal Task 5 that Task 3 has shutdown.
           -- Preform Task 4 shutdown
           Signal Task 5 that Task 4 has shutdown.


Procedure 1 which contains one task 

  Task 5: A. Receive the number from Task 3
             Calculate a total
             print Total and the Sum
             keep a running total.

  Procedure 1. Wait for command from user
                 Startup
                   Signal Task 4 to perform startup
                   Print any signals received from Task 4
                   Startup Task 5 counting routine ( part A )
                 Shutdown
                   Wait for shutdown command from user
                   Signal Task 4 to perform shutdown 
                   Print any signals received from Task 4
                   Print a shutdown signal that Task 5 is shutdown
                   Print a shutdown signal that Task 5 has shutdown


This project may seam complex but it is not. TASK 2 and 4 are 
operational duplicates in nature. TASK 3 and 5 are functional 
similar, they both perform a summation, except for Task 3 which 
transmit the data to another task while Task 5 just prints the data. 

Also, another point of decision in the lab or classrom. Is procedure 1 
a seperate Task, without the convension of a Task body.



In <4737291e$0$27064$4d3efbfe@news.sover.net>, "Peter C. Chapin" <pchapin@sover.net> writes:
>I have the luxury of teaching a course next semester that can be about
>anything I want. It's a course on "special topics" and the content is at
>the discretion of the instructor.
>
>I would like to teach the students some Ada.
>
>The students in question are already competent programmers (in the
>college student sense, that is). They have taken two courses in C/C++
>and so should be familiar with basic programming concepts, including
>concepts like encapsulation, (operator) overloading, and inheritance.
>The programs they have worked on so far have been typical programming
>exercises given in first courses: nothing large or complicated.
>
>The course I'll be teaching has two hours of lecture per week plus a
>three hour "lab" period where the students can work on some sort of
>project or assignment in a supervised setting. So there is a fair amount
>of time available.
>
>My thought was to cover the basics of Ada, the language, in the first
>half (third?) of the course. My expectation is that because of their
>background, the students will pick up the basic ideas fairly quickly.
>The question becomes: in what direction should I take the rest of the
>course? I would like to talk about something that shows the language in
>a good light as well as captures student interest. Some kind of
>introduction to a GUI library or network library might be good (the
>students have never done any GUI or network programming before). Also
>because I teach in a computer engineering curriculum, low level device
>control applications would be reasonable and appropriate as well.
>
>Anyway, I'm sure I can put something together. However, I thought I
>would ask here to see if anyone has some suggestions for libraries,
>tools, etc, that I might look at as I prepare materials for next semester.
>
>In case it matters, I'll be using the GNAT compiler.
>
>Thanks!
>
>Peter




  parent reply	other threads:[~2007-11-12 11:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11 16:09 Suggestions for topics in an Ada course? Peter C. Chapin
2007-11-11 17:15 ` Jeffrey Creem
2007-11-11 18:29   ` Peter C. Chapin
2007-11-11 19:32 ` Larry Kilgallen
2007-11-12 11:33   ` Peter C. Chapin
2007-11-12  0:02 ` Ed Falis
2007-11-12 11:44   ` Peter C. Chapin
2007-11-12  0:59 ` Steve
2007-11-12  4:29   ` wilson
2007-11-12 11:39     ` Peter C. Chapin
2007-11-12 13:34       ` Brian Drummond
2007-11-13  3:31         ` Peter C. Chapin
2007-11-13 13:50           ` Maciej Sobczak
2007-11-13 13:53           ` Brian Drummond
2007-11-12  7:42   ` adaworks
2007-11-12 11:40     ` Peter C. Chapin
2007-11-12 11:57   ` Stefan Lucks
2007-11-12 11:54 ` Stefan Lucks
2007-11-13  3:27   ` Peter C. Chapin
2007-11-12 11:56 ` anon [this message]
2007-11-12 15:53   ` John McCormick
2007-11-12 16:12     ` Hyman Rosen
2007-11-12 16:13       ` Hyman Rosen
2007-11-12 17:38       ` adaworks
2007-11-12 18:12         ` Hyman Rosen
2007-11-12 17:45     ` adaworks
2007-11-12 20:45       ` Jerry Petrey
2007-11-13  3:33     ` Peter C. Chapin
2007-11-13  5:17       ` jimmaureenrogers
2007-11-16 15:48 ` Marco
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox