Jump to content

  •  

  • iBotModz CBox


    Photo

    [REQUEST]Factorial Calculator?


    • Please log in to reply
    2 replies to this topic

    #1 Joe Walls

    Joe Walls

      Corporal Grade 2

    • Members+

    • 258 posts
    • Joined: 12-February 09
    • Location:United States (WA)

    Posted 12 May 2009 - 08:17 AM

    How would I make a factorial calculator using
    1 textbox(txtInput)
    1 fixed textbox(txtOutcome)
    1 button(cmdCalculate)

    I'm not sure how I code the but I know this will make a multiply function.(if I made a secon textbox)

    txtOutcome.text = txtInput1.text * txtInput2.text

    That's pretty much what I know bout calculators except I can add subtract and divide also

    #2 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08
    • Gender:Male
    • Location:Canada, ON

    Posted 12 May 2009 - 08:36 AM

    It's relatively difficult to create a calculator with 1 textbox. I didn't learn it until grade 12, but it was rather easy since I had a year of experience.

    I'll upload some sources later today I made at school. They are in VB6 though.

    #3 dschu012

    dschu012

      Private Grade 2

    • Members+

    • 83 posts
    • Joined: 19-March 08

    Posted 15 May 2009 - 10:37 AM

    Factorial should be pretty easy since you only need a number as an input

    http://www.megaupload.com/?d=4YNY16JU

    Here is an example of a factorial calculator. If the answer is above 18446744073709552000 it won't work because that is the maximum size of a ulong. So as long as you use it to calculate the factorials of numbers below 60ish you should be good.