Hello
Can someone explain this plz and where to learn about it. Thx
students: numbered 0 to m-1
courses: numbered 0 to n-1
M[i,j]=mark obtained by student i on course j
/* obtain the average mark for student i */
a:=0; j:=0; n=number of columns of M
While j<n
a:=a+M[i, j];
j:=j+1;
EndWhile
a:=a/n;
6 replies to this topic
#1
Posted 22 November 2010 - 03:44 AM
|
|
|
#2
Posted 22 November 2010 - 05:04 AM
Hmm... This seems suspiciously like homework. Is this a school assignment?
-CDG10620
Software Developer
Software Developer
#3
Posted 22 November 2010 - 05:08 AM
I don't know the actual language of the code. But it's very similar with Pascal. In fact only EndWhile and the missing of keyword do and begin after while line that made it definitely not pascal. Other than those, all of them were Pascal.
About what it does:
These were totalling marks from all courses the student i attended.
And this calculates the average mark.
About what it does:
Quote
While j<n
a:=a+M[i, j];
j:=j+1;
EndWhile
a:=a+M[i, j];
j:=j+1;
EndWhile
These were totalling marks from all courses the student i attended.
Quote
a:=a/n;
And this calculates the average mark.
#4
Posted 22 November 2010 - 05:13 AM
I saw this in a powerpoint lecture (not saw, found it online when someone asked the same question ages ago), it is most likely homework.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 22 November 2010 - 10:58 AM
I suspect it's just pseudocode that's based on Pascal syntax.
#6
Posted 23 November 2010 - 01:36 AM
No its not a homework, it was given in a lecture and i didn't understand it.
#7
Posted 23 November 2010 - 05:15 PM
It still appears to be pseudocode.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









