Gatito wrote:It certainly works, but it doesn't feel complete yet.
The way you wrote it you must know beforehand which number to type first,second.... in order to find the right value for max & min.
You should make your program take the values from the user by typing them rather than from the script itself. You also may want to store them in an array ( or a list maybe? ) and use some build-in sort function.
Now that you have them sorted you should use jgreen45's algorithm ( with a slight modification in order ) and implement it to find always the max & min values correctly regardless of what the user types.
You can even go further and maybe even put some input validation code so the user gets an error message displayed to him when he types a number not between 0-9 or characters.
Users browsing this forum: No registered users and 0 guests