Computer Science Canada Program Crash |
Author: | kk [ Tue Jan 03, 2006 1:38 am ] | ||
Post subject: | Program Crash | ||
Hi, I am wondering whether you could help me out. This program generates a math equation with three numbers; the first two numbers are multiplied, and the answer of the equation is the division of this product with the last number. I am using 1 digit numbers to test the program. The equation that is generated is put in a counted loop but the program crashes(it is NOT RESPONDING) only after the counted loop is finished running.(not shown) Here is a section of code that I am running. Thanks in advance. ![]() I am new to visual basic, so I am not aware of any MEMORY MANAGEMENT issues, so feel free to add any coding optimizations. I've only included comments and not the code . If they are needed, feel free to ask for them. ![]()
|
Author: | HazySmoke)345 [ Tue Jan 03, 2006 5:55 pm ] | ||
Post subject: | |||
Your lines are very confusing indeed... It sounds like a pretty simple program but the script is so long. Since I don't know the whole script, I don't know if the length necessary or not. I'd just simply do something like this:
|
Author: | cool dude [ Tue Jan 03, 2006 6:40 pm ] | ||
Post subject: | |||
HazySmoke)345 wrote:
Shouldn't the a*b be in brackets since it is bedmass |
Author: | [Gandalf] [ Tue Jan 03, 2006 8:18 pm ] |
Post subject: | |
The correct acronym is BEDMAS, and it doesn't matter since multiplication and division just go left to right. Test it out and see for yourself. |
Author: | cool dude [ Tue Jan 03, 2006 11:38 pm ] |
Post subject: | |
[Gandalf] wrote: The correct acronym is BEDMAS, and it doesn't matter since multiplication and division just go left to right. Test it out and see for yourself.
u r right it is BEDMAS and i did notice it but unfortunately nobody made an edit button for visual basic forums so i couldn't edit it. and yes it doesn't matter about the brackets but i couldn't test it at the moment since i didn't have VB on the computer i was using and thats why i said "shouldn't it be" instead of "it has to be" |
Author: | [Gandalf] [ Wed Jan 04, 2006 2:16 am ] |
Post subject: | |
There's no edit button in any help forum. What grade are you in? Even if you're not really good in math, you shouldn't really need to check, just think: a = 6 b = 2 c = 4 a*b/c = 3 (a*b)/c = 3 a*(b/c) = 3 ![]() |
Author: | cool dude [ Wed Jan 04, 2006 10:31 am ] |
Post subject: | |
[Gandalf] wrote: There's no edit button in any help forum.
![]() actually i believe there is an edit button in the turing help forum because i posted there and then i edited my posts. secondly yes i know bedmas so u don't have to teach me it but thanks anyways ![]() |
Author: | [Gandalf] [ Wed Jan 04, 2006 4:52 pm ] |
Post subject: | |
Actually, there is no edit button there either. Now let's try to keep this topic on topic. ![]() |
Author: | Brightguy [ Wed Jan 04, 2006 10:36 pm ] |
Post subject: | Re: Program Crash |
What you posted looks ok, if the loop isn't ending make sure cboDivDigits.Text > 0 and that Dividend has more factors than the excluded ones. |