Answer to Question #256685 in Algorithms for Dion Martins

Question #256685
  1. 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.1 Mix the for loop with a do-while


1
Expert's answer
2021-10-29T11:55:31-0400
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS