Click here to Skip to main content
15,891,687 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionC# convert problem Pin
Xmen Real 26-Apr-07 15:29
professional Xmen Real 26-Apr-07 15:29 
AnswerRe: C# convert problem Pin
MatrixCoder26-Apr-07 16:05
MatrixCoder26-Apr-07 16:05 
GeneralRe: C# convert problem Pin
Xmen Real 26-Apr-07 16:13
professional Xmen Real 26-Apr-07 16:13 
QuestionAbsolutely URGENT help needed - Collections Pin
new_rez26-Apr-07 13:11
new_rez26-Apr-07 13:11 
AnswerRe: Absolutely URGENT help needed - Collections Pin
Christian Graus26-Apr-07 13:36
protectorChristian Graus26-Apr-07 13:36 
GeneralRe: Absolutely URGENT help needed - Collections Pin
new_rez26-Apr-07 14:19
new_rez26-Apr-07 14:19 
GeneralRe: Absolutely URGENT help needed - Collections Pin
new_rez26-Apr-07 14:24
new_rez26-Apr-07 14:24 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Christian Graus26-Apr-07 14:36
protectorChristian Graus26-Apr-07 14:36 
Error conditions: If you encounter a negative number (e.g. -151), display the message
Negative number: -151
Don't take it into account in your calculations.
If you encounter a number greater than 100 (e.g. 199), display the message Value exceeds 100: 199 and exit immediately.
If there are no valid numbers in the array to process, display the message No numbers to process! and exit immediately.

OK, basically, what you need to do, is do what you're doing now ( adding the numbers to get an average). But, you need to use a counter to remember how many numbers you added. If you find a negative number, don't add it, don't increment the counter, and display a message that you found such a number. Again, on the console this would be trivial. As it stands, you need to build it into your GUI, so you probably want to use a string builder to build the end result message with all the info you want to show, and then assign it to a labgl. Use Environment.NewLine to put newlines in your string.

If you find a number greater than 100, then put your string into the display message and break out of your processing. You may need a bool to tell you if you still need to calculate the average or not.

If the number of valid numbers found at the end of processing is 0, then you can show the 'no valid numbers found' message instead of an average.


Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

GeneralRe: Absolutely URGENT help needed - Collections Pin
new_rez26-Apr-07 14:45
new_rez26-Apr-07 14:45 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Christian Graus26-Apr-07 14:50
protectorChristian Graus26-Apr-07 14:50 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Colin Angus Mackay26-Apr-07 14:25
Colin Angus Mackay26-Apr-07 14:25 
GeneralRe: Absolutely URGENT help needed - Collections Pin
new_rez26-Apr-07 14:27
new_rez26-Apr-07 14:27 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Colin Angus Mackay26-Apr-07 14:33
Colin Angus Mackay26-Apr-07 14:33 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Christian Graus26-Apr-07 14:36
protectorChristian Graus26-Apr-07 14:36 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Christian Graus26-Apr-07 14:33
protectorChristian Graus26-Apr-07 14:33 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Christian Graus26-Apr-07 14:32
protectorChristian Graus26-Apr-07 14:32 
AnswerRe: Absolutely URGENT help needed - Collections Pin
Christian Graus26-Apr-07 14:15
protectorChristian Graus26-Apr-07 14:15 
GeneralRe: Absolutely URGENT help needed - Collections Pin
Colin Angus Mackay26-Apr-07 14:20
Colin Angus Mackay26-Apr-07 14:20 
AnswerRe: Absolutely URGENT help needed - Collections Pin
Colin Angus Mackay26-Apr-07 14:19
Colin Angus Mackay26-Apr-07 14:19 
Questionregular expression Pin
aldo hexosa26-Apr-07 12:50
professionalaldo hexosa26-Apr-07 12:50 
AnswerRe: regular expression Pin
Christian Graus26-Apr-07 13:03
protectorChristian Graus26-Apr-07 13:03 
GeneralRe: regular expression Pin
aldo hexosa1-May-07 3:41
professionalaldo hexosa1-May-07 3:41 
GeneralRe: regular expression Pin
Christian Graus1-May-07 10:37
protectorChristian Graus1-May-07 10:37 
QuestionCan't access AppSettings of appConfig file Pin
PollyAnna33326-Apr-07 6:01
PollyAnna33326-Apr-07 6:01 
AnswerRe: Can't access AppSettings of appConfig file Pin
Dave Kreskowiak26-Apr-07 6:38
mveDave Kreskowiak26-Apr-07 6:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.