-
Notifications
You must be signed in to change notification settings - Fork 0
/
total_marks_avg_marks_from_n_no_of_students.fprg
40 lines (40 loc) · 2.35 KB
/
total_marks_avg_marks_from_n_no_of_students.fprg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="harsh"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-12-09 11:17:42 AM"/>
<attribute name="created" value="aGFyc2g7SEFSU0hJVEg7MjAyMi0xMi0wOTsxMDoxMTozMCBBTTsyMzkw"/>
<attribute name="edited" value="aGFyc2g7SEFSU0hJVEg7MjAyMi0xMi0wOTsxMToxNzo0MiBBTTs0OzI1MTE="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="n, totalmarks, avgmarks" type="Integer" array="False" size=""/>
<output expression=""enter the number of students"" newline="True"/>
<comment text="the size of the array is the number of students"/>
<input variable="n"/>
<declare name="students" type="Integer" array="True" size="n"/>
<declare name="a, b" type="Integer" array="False" size=""/>
<for variable="a" start="0" end="n-1" direction="inc" step="1">
<declare name="rollno" type="Integer" array="True" size="n"/>
<output expression=""enter your roll number"" newline="True"/>
<input variable="rollno[a]"/>
<declare name="subject" type="Integer" array="True" size="5"/>
<declare name="m" type="Integer" array="False" size=""/>
<comment text="number of subjects is 5"/>
<for variable="m" start="0" end="4" direction="inc" step="1">
<declare name="submarks" type="Integer" array="False" size=""/>
<output expression=""enter your subject" &m+1& "marks"" newline="True"/>
<input variable="submarks"/>
<assign variable="subject[m]" expression="submarks"/>
</for>
<assign variable="totalmarks" expression="subject[0]+subject[1]+subject[2]+subject[3]+subject[4]"/>
<output expression=""your total marks are" &totalmarks" newline="True"/>
<assign variable="avgmarks" expression="totalmarks/5"/>
<output expression=""average marks are" &avgmarks" newline="True"/>
</for>
</body>
</function>
</flowgorithm>