00:01
Okay, so in this question we want to write pseudocode, so nothing in a specific language, only pen and paper.
00:09
And to ask the user for 20 numbers, then store the numbers in an array, and display the lowest number, the highest number, the total numbers, and the average number in the array.
00:24
You can only write in pseudo code.
00:28
So first, i'm going to need an array of values.
00:31
I'm going to have a...
00:33
It will start empty.
00:35
So i will say array of values.
00:41
I'm going to call our valve and this is an empty array.
00:49
Then we need to ask the and we need a counter to see how many things we put in the array but we can also use the length of the array.
00:59
So let's say we can use the length.
01:01
We can say while and we assume that we start counting.
01:09
From zero so the first element of the array will be index zero so while the length of our array length gt h is less than 20 then we want to it depends on how the language is but we want to add user input to the and of my array of value.
02:06
So that's the first step in my pseudocode.
02:10
Now this, for example, in c++, you could have array of values that push back.
02:25
For example, that would be one of the ways to write it in c++.
02:31
In python you could have an array of values that app and with the user input so different languages have different way of adding things.
02:50
Now we need to find three values so we need to find the total, the min, i'm simply going to call it min, mac total, and average we will need to declare those variables somewhere and here you're going well actually i'm going to declare them all to zero the min is equal to zero max is equal to zero total total eot will be equal to zero and the average will be equal to zero and then okay, so here the minimum should not be declared with a value like this.
04:06
Neither should be max because i thought we were only working with positive integer, but this is not specified in the question.
04:15
We declare min and max as empty values and total and average you can initialize them at zero.
04:24
And here you have, you can have, for example, min will be equal to the first element of your array of values.
04:37
So we index at zero...