Do the necessary planning (IPO) and write an algorithm in pseudo code for the following:
Write an algorithm that will accept the following for 100 students: The students’ name (studName) and 3 test marks (marks), as well as one exam mark (examMark). The program must calculate the final mark (finMark) for every student. The final mark comprises of 50% of the exam mark added to 50% of the average (agv) of the 3 tests.
Display the final mark for every student.
1. Use a simple for-loop to determine the answer.
Algorithm:
Start
Declare varaible integer studName= ""
Declare array integer marks[3]
Declare varaible integer examMark
Declare varaible integer finMark
Declare varaible integer agv
for i = 1 to 100 step 1 do
Read studName
for j=0 to 3 step 1 do
Read marks[i]
end for
Declare varaible integer sum=0
for j=0 to 3 step 1 do
sum=sum+marks[i]
end for
end for
Set agv=sum/3
Set finMark=agv*0.5+examMark*0.5
Display finMark
Stop
IPO
Comments
Leave a comment