Visual Basic?
Yahoo Manager asked:
How would I write a visual basic program that will generate 10 random numbers, store them in an array, then output the the highest and lowest values
Related posts:
- Can anybody send me some notes for MS visual basic programming? Jaya asked: I am a biginer of in programming in...
- how to make a visual basic program to record a 2 pin connection on a serial port? baseballman999 asked: I run a retail store and i would...
- Really Challenging Visual Basic Question Problem? ABC asked: I have a little problem. I need to...
- How do I write this substring code in Visual Basic? Robert Nesta M asked: I am writing a Visual Basic...
- Can i write BASIC or VISUAL BASIC programs on the internet? buckbucknumber2000 asked: I’d like to be able to write a...
Filed Under Programming & Design |
Tagged With Array, Random Numbers, Visual Basic Program
Comments
2 Responses to “Visual Basic?”
Start by delaring your array,
then loop 10 times, setting the value of each array item to a random number
To find the max and min, walk the array in a loop. Declare two variables and set the values of each to the first array item.
In the loop, find out if the current value is larger than max. If it is, then your new max value is that number. If not, find out if the current number is lower than your min. If it is, then your new min value is that number
You get some expert help from