שפת C
Question:

כתוב תוכנית אשר רצה על המספרים מ 1 עד 100 , ומדפיסה את הממוצע של המספרים שמתחלקים על 5 בלי שארית .

Provide an answer by clicking on "Map" and then on "Add an Answer".



Results, Analysis and Discussion


Comments:
1.  Rabea Ghayda (23.11.2016 pm 06.32.08)
My Answer..!

#include<stdio.h>
void main()
{
    int x, count=0,sum=0, avg;
    for (x = 1; x <= 100; x++)
    {
    
        if (x % 5 == 0)
        {
            count = count + 1;
            sum = sum + x;
        }
        
    }
    avg = sum / count;
    printf("%d ", avg);
}

2.  Even Zur Ziv (04.06.2018 pm 12.56.30)
Comment on The Question

Dear All,

 

Reinforcement:

The question was clearly phrased; it was made clear to the student what should be the final result.

Elaboration:

I would like to suggest the following points to be considered by the author of the question, in order to support deeper learning.

  • Challange the program with different inputs, and write test code.
  • Challange the author of the code to implement by using two different code languages (distinict by nature: as R/Python/Matlab vs. Iterative code as C/C++/C#), the student will be able to contemplate over the strengths of each language in the domain.

Best,

Ziv

3.  bar alon (04.06.2018 pm 06.06.04)
peer feedback

reinforcement: 

positive: the task is clearly put. negative: not providing further tasks of the same kind.

statement: this is not really an inquiry question, but more of an assignment.

elaboration: i would add, for the same task, to try and program it by a few different ways and in different programing languages, and try to see ehich is the more efficient way.

4.  bar alon (04.06.2018 pm 06.20.07)
peer review (cont.)

another thing- it is possible to use this kind of programing-based problem solving and connect it to our everyday lives. for example, make this program more general instead of the specific 1-100 avg,  where the user could input any value they prefer - and thus making this program more approachable to many everyday tasks we encounter- such as averaging our bills, salaries and so on, making small daily inconveniences simpler on the one hand, and more thought provoking on the other. 



History of edits
Edited BY: Belal Hejaze Edit Date: 2016-11-16 23:45:17
Edited BY: Belal Hejaze Edit Date: 2016-11-16 21:10:56
Created By: Belal Hejaze Edit Date: 2016-11-16 21:10:08
More Interactive Questions that might interest you In Computer