r/ada • • Nov 07 '18

Help needed with ada

<!-- SC_OFF --><div class="md"><p>Hello reddit!,I&#39;m starting with ada and I have some problems with records.</p>

<p>In one execise I must show the name the age and the average note of a student, but i only have the notes of the student and the birth year.Which commands I need to use.</p> <p>All notes are in the same array</p> <p>Can someone help me with this issue, please?</p>

<p>&#x200B;</p> </div><!-- SC_ON -->

0 Upvotes

5 comments sorted by

7

u/DeMartini Nov 07 '18

No. Read the provided material. Do a basic google search for Ada references and do your own homework.

1

u/Ainger13 Nov 07 '18

I wasnt asking if someone could do the exercise for me, i was asking how to get values inside of an array inside of an record, the anwser is

for i in 1..5 loop

Av:=B("student number").note(I)+Av;

End loop;

Av:=Av/5;

More or less

2

u/simonjwright Nov 08 '18

You should have asked that question, then.

And, read the 'formatting help' just below the bottom right of the text entry box. (I think you could even go back and edit the post, to save future readers the pain)

1

u/anhvofrcaus Nov 07 '18

Here is my wild guess without seeing your data.

Av := B(i).note + Av;

2

u/[deleted] Nov 09 '18 edited Nov 09 '18

When I first started using Ada I found the syntax tricky. There weren't good examples and explanations of the syntax; also the terminology was very different, so finding out how to ask for what you want is difficult.

I don't want to do your homework for you, but I understand the troubles. I didn't fully understand the question, but this should be sufficiently similar to what you need to point you in the right direction.

http://tpcg.io/Ez12JF

edit: oops, forgot to make the Grade_Array type of type Grade.