SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast Great-morduk's Avatar
    Join Date
    Oct 2004
    Location
    israel
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Task from School :) help anyone!?

    Hi people
    I've got this task from php class at school but I realy don't know where to start, maybe someone can help me out:

    I need to... 1. Generate 5, 2 digit numbers (i.e. 20, 43, 65, 49, 22) randomly without repeating any number
    then 2. I need to add 23% of each number to itself and round it up (i.e. if I got 43 then I need to add 23% to it which is 9.89 means 43+9.89=52.89 then round it up which means 53) and then 3. I need to add them all together and substruct from 10000 (i.e. after procedures 1 and 2 I'll have 25, 53, 80, 61, 28 which means 247 after adding them together and when substructing from 10000 I'll get 9753)

    o.k.
    so it sounds simple but Its realy difficult for me... can anyone help?
    ohh yehh and one more thing, I need to make it user friendly on the web which means... I'll have to make a button like next, and each time you press it it will jump a procedure and write down which numbers it took and what is happenning to the number (like add or % percent addon or substruct etc.etc.)
    it seems like I'm going MAD!!!
    my mail

  2. #2
    SitePoint Zealot lemkepf's Avatar
    Join Date
    Feb 2002
    Location
    WI, USA
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude.... that's simple math stuff.
    First.... Check out http://www.php.net/rand for the random function. (check the user comments at the bottom, that always helps me)
    Second... Searh php.net for all the other math functions. very easy to find...
    Third... your page design should go like this:
    1. Generate numbers, dislay them and a next button. (put a hidden variable or something that is named "nextpage" and equals "page2" or something.
    2. Check the $_POST['nextpage'] to display second part.
    3. Display results and another next button.
    4. Rinse, repeat.
    Happiness is a belt-fed weapon
    Consciousness: That annoying time between naps.
    Modevia Web Services LLC.

  3. #3
    SitePoint Addict Fire59's Avatar
    Join Date
    Aug 2003
    Location
    mn
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you learning anything if we do this for you?

  4. #4
    SitePoint Zealot lemkepf's Avatar
    Join Date
    Feb 2002
    Location
    WI, USA
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Agreed.... that's why i was quite vague on things
    Happiness is a belt-fed weapon
    Consciousness: That annoying time between naps.
    Modevia Web Services LLC.

  5. #5
    Non-Member bronze trophy geniusgoalie's Avatar
    Join Date
    Sep 2004
    Location
    Buffalo, USA
    Posts
    979
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Great-morduk
    Hi people
    I've got this task from php class at school but I realy don't know where to start, maybe someone can help me out:

    I need to... 1. Generate 5, 2 digit numbers (i.e. 20, 43, 65, 49, 22) randomly without repeating any number
    then 2. I need to add 23% of each number to itself and round it up (i.e. if I got 43 then I need to add 23% to it which is 9.89 means 43+9.89=52.89 then round it up which means 53) and then 3. I need to add them all together and substruct from 10000 (i.e. after procedures 1 and 2 I'll have 25, 53, 80, 61, 28 which means 247 after adding them together and when substructing from 10000 I'll get 9753)

    o.k.
    so it sounds simple but Its realy difficult for me... can anyone help?
    ohh yehh and one more thing, I need to make it user friendly on the web which means... I'll have to make a button like next, and each time you press it it will jump a procedure and write down which numbers it took and what is happenning to the number (like add or % percent addon or substruct etc.etc.)
    I'll do it for you for $500

  6. #6
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by geniusgoalie
    I'll do it for you for $500
    LOL bargin that is!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  7. #7
    SitePoint Enthusiast Great-morduk's Avatar
    Join Date
    Oct 2004
    Location
    israel
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    O.k. I did it by myself... I didn't wanted anyone to do it for me, I just wanted direction.
    it seems like I'm going MAD!!!
    my mail


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •