comp.lang.ada
 help / color / mirror / Atom feed
* Using ADA to write a Grade Program (ARRAYS)
@ 1998-04-19  0:00 Sam
  1998-04-19  0:00 ` Robert Dewar
  0 siblings, 1 reply; 2+ messages in thread
From: Sam @ 1998-04-19  0:00 UTC (permalink / raw)



I am very pleased with the response, I guess I need to include further
details:

I need to write an ADA program that reads grade information
(names/grades) into two ARRAYS, one for names the other for grades.
Then compute the average, print out a file that shows the student's
name, his grade and the word Satisfacory or Unsatisfactory, if the grade
is within 10 points of average.  Here is the code I have so far:

Type float ARRAY is ARRAY (1..20) of Floats
  A: Float
   i : Integer := 0
   Avg, Sum, Below : Integer := 0
Begin
    While Not Endo Of File Loop
      Ada.Integer_Text_IO.Get (a(i));
      Sum := Sum + a(i);
      i := i + 1;
      End Loop

Avg := Sum/ "this I am not sure about?"

    For i in i..(i-1) Loop
    If a(i) < avg THEN
    Below := Below = 1;
    ELSIF a(i) > avg THEN
    Above := Above + 1;
    Else
    Same := Same + 1;
    End If
   End Loop............this is where my problem happens, how do I attach
a string to this, and how do I produce the end result......I am kinda
stuck, thanks to anyone who assists me.

Sam





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-04-19  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-19  0:00 Using ADA to write a Grade Program (ARRAYS) Sam
1998-04-19  0:00 ` Robert Dewar

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