00:01
Okay, so in this question you want to write a program that will continuously take grades between 0 and 100.
00:13
And until you write stop, it will add them to the total and output the average as it update.
00:23
So i took the code that was written and apparently this code has an infinite loop.
00:29
So we're going to try to run this code.
00:31
So here i'm going to write, let's say, i got 75, and then the code will simply output 75 infinitely.
00:44
And we're wondering why is that? so we're going to go through the code.
00:50
So the variable total is initialized at zero.
00:56
That's good.
00:58
The variable q, so the number of we can write a number.
01:03
Some comments to remember what each variable can represent.
01:08
So q is the number of grades already input.
01:22
So at the beginning you have zero grade that you input.
01:26
Then you in the score, you take as an input, so that's fine.
01:31
And then you have your loop.
01:32
While the score is different to stop, then you increase the number of grades that you entered.
01:42
So increase the number of grades which are entered.
01:49
That's good.
01:50
So far nothing's wrong.
01:54
I'm going to try to put all my comments in the same.
01:58
Then you update the total by adding the latest score...