Display the final mark for every student.
1.1 Mix the for loop with a do-while
1. For i from 1 to 100 do
2. Print a prompt to enter an i-th student name
3. Read name as string
4. Set sum equal 0
5. Set n equal 1
6. Do
7. Print a prompt to enter n-th mark
8. Read mark as integer
9. Add mark to sum
10. Add 1 to n
11. While n <= 3
12. Set agv = sum / 3
13. Prin a prompt to enter exam mark
14. Read exam as integer
15. Set final equal 0.5*agv + 0.5*exam
16. Print student name and final
17. Next i
Comments
Leave a comment