First released app

Discussion in 'Programming & Scripting' started by confused5, Nov 19, 2008 with 12 replies and 322 views.

  1. confused5

    confused5 Enthusiast

    Messages:
    766
    Ratings:
    75
    I've been working with C++ for a bit now but here's a simple app i made to help with my factoring homework. Basically it takes in a number and a range (like 1-10) and it outputs all numbers between the ones that you specify that divide evenly into the first number you entered, and then outputs all the numbers within the range you specified that divide into it evenly. In case that was a little confusing....
    example:[​IMG]



    Just thought I'd share. Code and dl:
    Code:
    http://www.megaupload.com/?d=WN3ZM8IJ
     
    • Like Like x 1
  2. Michael Allison

    Michael Allison Enthusiast

    Messages:
    232
    Ratings:
    13
    Easy enough, but it's nice of you to post it. Pretty handy if you get one of those retarded math puzzler things that can't be solved in a simple algebraic way.
     
  3. OP
    confused5

    confused5 Enthusiast

    Messages:
    766
    Ratings:
    75
    Thanks. yeah it does. This pwns for hard trinomials too lol

    Btw to anyone who wants to modify the code, you can take out double result (line 23) and result = number / range1 (line 29), i forgot to take them out when i changed my logic
     
  4. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    I can see where this could be useful.

    Good job man
     
    • Like Like x 1
  5. TorMenT

    TorMenT VIP VIP

    Messages:
    1,052
    Ratings:
    97
    Good job for your first program. Very useful to people still in math courses.
     
    • Like Like x 1
  6. Michael Allison

    Michael Allison Enthusiast

    Messages:
    232
    Ratings:
    13
    Or who just enjoy the stimulation you receive from math.

    No homo.
     
  7. Leering

    Leering (ノಠ益ಠ)ノ彡┻━┻

    Messages:
    2,705
    Ratings:
    472
    Good job on your first app.
    Actually I might have to use this later...:thumbup:
     
    • Like Like x 1
  8. OP
    confused5

    confused5 Enthusiast

    Messages:
    766
    Ratings:
    75
    Glad to hear it :smile:, sped up my algebra 2 homework pretty nicely
     
  9. unknown v2

    unknown v2 VIP VIP

    Messages:
    3,229
    Ratings:
    1,238
    We just go to this section in Algebra 2. Thanks :smile:
     
  10. LFCGirl

    LFCGirl Contributor

    Messages:
    2,186
    Ratings:
    134
  11. OP
    confused5

    confused5 Enthusiast

    Messages:
    766
    Ratings:
    75
    Thanks for the support guys

    Also for those still in algebra 2, i made this a little bit ago to help with homework again :biggrin:, it just runs a test on a number to see if it has any integer squares. It stops when the numbers start getting too big too.

    Dl & Code:
    Code:
    http://www.megaupload.com/?d=SZRBLW55
     
  12. dschu012

    dschu012 Member

    Messages:
    760
    Ratings:
    381
    Nice first app. In the future I would use a for loop instead of that while statement you used. Saves lines and to me would make the code much more readable. Something like this.
    Code:
    for(;range1 <= range2; range1++)
    if(number%range1 == 0)
    cout << range1 << endl;
    but your way works too.
     
  13. OP
    confused5

    confused5 Enthusiast

    Messages:
    766
    Ratings:
    75
    Thanks, I didn't think of that I'll have to try it out