-
Notifications
You must be signed in to change notification settings - Fork 0
/
Student_marks.fprg
67 lines (67 loc) · 4.37 KB
/
Student_marks.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="HP"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-12-09 08:00:06 PM"/>
<attribute name="created" value="SFA7REVTS1RPUC1MM1JERUtGOzIwMjItMTItMDk7MDk6Mzk6MDIgQU07MjQ5Ng=="/>
<attribute name="edited" value="SFA7REVTS1RPUC1MM1JERUtGOzIwMjItMTItMDk7MTA6NTM6MzAgQU07OTsyNjAx"/>
<attribute name="edited" value="dmlzaGE7VklTSEFMOzIwMjItMTItMDk7MDg6MDA6MDYgUE07MTsyMzc4"/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<comment text="getting the number of students "/>
<declare name="n" type="Integer" array="False" size=""/>
<output expression=""Enter the number of students"" newline="True"/>
<input variable="n"/>
<if expression="n>0">
<then>
<comment text="Declaring arrays"/>
<declare name="sub1, sub2, sub3, sub4, sub5, roll, total" type="Integer" array="True" size="n"/>
<declare name="avg" type="Real" array="True" size="n"/>
<comment text="Declaring other variables "/>
<declare name="x, input" type="Integer" array="False" size=""/>
<comment text="For loop for getting inputs "/>
<for variable="x" start="0" end="n-1" direction="inc" step="1">
<comment text="getting the roll number"/>
<output expression=""Enter roll number of stundent "&x+1" newline="True"/>
<input variable="input"/>
<assign variable="roll[x]" expression="input"/>
<comment text="Geting the marks in 5 subjects"/>
<output expression=""Enter marks of stundent in maths"" newline="True"/>
<input variable="input"/>
<assign variable="sub1[x]" expression="input"/>
<output expression=""Enter marks of stundent in social studies"" newline="True"/>
<input variable="input"/>
<assign variable="sub2[x]" expression="input"/>
<output expression=""Enter marks of stundent in physics"" newline="True"/>
<input variable="input"/>
<assign variable="sub3[x]" expression="input"/>
<output expression=""Enter marks of stundent in chemistry"" newline="True"/>
<input variable="input"/>
<assign variable="sub4[x]" expression="input"/>
<output expression=""Enter marks of stundent in english"" newline="True"/>
<input variable="input"/>
<assign variable="sub5[x]" expression="input"/>
<comment text="calculating the total marks"/>
<assign variable="total[x]" expression="sub1[x]+sub2[x]+sub3[x]+sub4[x]+sub5[x]"/>
<comment text="calculating the average marks"/>
<assign variable="avg[x]" expression="total[x]/5"/>
</for>
<comment text="outputing the final values"/>
<for variable="x" start="0" end="n-1" direction="inc" step="1">
<output expression=""Roll number of the student :"&roll[x]" newline="True"/>
<output expression=""Marks of the student :"&sub1[x]&", "&sub2[x]&", "&sub3[x]&", "&sub4[x]&", "&sub5[x]" newline="True"/>
<output expression=""total marks of the student :"&total[x]" newline="True"/>
<output expression=""Average marks of the student :"&avg[x]" newline="True"/>
</for>
</then>
<else>
<output expression=""The number of students cannot be less than 1"" newline="True"/>
</else>
</if>
</body>
</function>
</flowgorithm>