-
Notifications
You must be signed in to change notification settings - Fork 0
/
students_marks_total.fprg
49 lines (49 loc) · 3.77 KB
/
students_marks_total.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
41
42
43
44
45
46
47
48
49
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="hamsi"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-12-09 11:11:39 AM"/>
<attribute name="created" value="aGFtc2k7REVTS1RPUC0wSk1GUUkyOzIwMjItMTItMDk7MDk6MTg6MDggQU07Mjg1OQ=="/>
<attribute name="edited" value="aGFtc2k7REVTS1RPUC0wSk1GUUkyOzIwMjItMTItMDk7MTE6MTE6MzkgQU07NDsyOTYw"/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<comment text="inputVal takes the input from the user regarding the number of students.inputVal1 iterates for taking the input for each student.Val1 iterates the input for each of the 5 subjects.Output1 iterates to print the data of each student. Output2 iterates to print the marks of each subject. marksofSubs array is an array inside the array called marks- holds the value of marks fo all 5 subjects of one student. Average is an array that stores the average of the marks of all students. Total is an array that stores the total marks of all students. Rollno is an array that stores the roll number of all students."/>
<declare name="inputVal" type="Integer" array="False" size=""/>
<declare name="output1, output2, inputVal1, val1" type="Integer" array="False" size=""/>
<output expression=""Enter the number of students:"" newline="True"/>
<input variable="inputVal"/>
<declare name="loop" type="Integer" array="False" size=""/>
<declare name="rollno" type="Integer" array="True" size="inputVal"/>
<declare name="marks" type="Integer" array="True" size="inputVal"/>
<declare name="total" type="Integer" array="True" size="inputVal"/>
<declare name="average" type="Integer" array="True" size="inputVal"/>
<declare name="marksofSubs" type="Integer" array="True" size="5"/>
<for variable="inputVal1" start="0" end="inputVal-1" direction="inc" step="1">
<output expression=""Give the input for roll no of "&inputVal1+1&" student"" newline="True"/>
<input variable="rollno[inputVal1]"/>
<assign variable="total[inputVal1]" expression="0"/>
<for variable="val1" start="0" end="4" direction="inc" step="1">
<output expression=""Give the input for marks of "&val1+1&" subject"" newline="True"/>
<input variable="marksofSubs[val1]"/>
<assign variable="marks[inputVal1]" expression="marksofSubs[val1]"/>
<assign variable="total[inputVal1]" expression="marksofSubs[val1]+total[inputVal1]"/>
</for>
<assign variable="average[inputVal1]" expression="total[inputVal1]/5"/>
</for>
<for variable="output1" start="0" end="inputVal-1" direction="inc" step="1">
<output expression=""The data of the "&output1+1&" student is"" newline="True"/>
<output expression=""Roll number:"&rollno[output1]" newline="True"/>
<output expression=""Marks:"" newline="True"/>
<for variable="output2" start="0" end="4" direction="inc" step="1">
<output expression=""Subject"&output2+1&": "&marksofSubs[output2]" newline="True"/>
</for>
<output expression=""Total: "&total[output1]" newline="True"/>
<output expression=""Average: "&average[output1]" newline="True"/>
</for>
</body>
</function>
</flowgorithm>