Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Need Help Creating A Math Tutor Program (http://www.programmingforums.org/showthread.php?t=15440)

chapdizzle Mar 18th, 2008 10:52 PM

Need Help Creating A Math Tutor Program
 
I'm very new to visualbasic and need to create a program that acts as a math tutor.

In addition to the requirements specified in the text, also create the program to randomly create either an addition, multiplication, or a subtraction problem for each question. The range of numbers should be 0 to 100.

A few questions... Since there's no real input from the user, I could just make them all the boxes labels correct? Also, I have no idea how to code it so it will pick the numbers at random from 0-100. Lastly, I have no clue as to how I'm supposed to make it pick the multiplication/addition/subtraction at random as well. Help is greatly appreciated, and sorry, my computer intelligence isn't the highest :X

Ooble Mar 19th, 2008 4:07 AM

Re: Need Help Creating A Math Tutor Program
 
We need to know what version of Visual Basic you're using before we can help you with your random numbers thing, as it's implemented differently in Visual Basic 1-6 and Visual Basic .NET/Visual Basic 2003-2008.

Grich Mar 19th, 2008 6:43 AM

Re: Need Help Creating A Math Tutor Program
 
Sounds like someone has homework from school that he hasn't done. :D

grimpirate Mar 19th, 2008 2:42 PM

Re: Need Help Creating A Math Tutor Program
 
If you don't need any inputs, labels would indeed suffice. Algorithmically, you could do the following:
:

var random1 = random number from 0 to 100
var random2 = random number from 0 to 100
var operation = random number from 0 to 2
switch(operation) {
        case 0:
        set operation label to '+'
        display random1 + random2
        break;
        case 1:
        set operation label to '-'
        display random1 - random2
        break;
        case 2:
        set operation label to '*'
        display random1 * random2
        break;
}

I don't exactly remember VB all too well so just look up random number in the VB help files.


All times are GMT -5. The time now is 3:55 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC