Results 1 to 12 of 12
  1. #1
    Hydra
    Join Date
    Apr 2006
    Posts
    105
    BG Level
    3

    homework check :( (validity statement)

    not sure if i am doing this right but i need to make a validity check of a double that is between 1111111111 and 9999999999 and i was doing this for it:

    Code:
    if(upc < 1111111111)
    {Console.WriteLine("error UPC is to small");
      Invoice.UPC // so lost there dont know how to redo the class where it asks to input the UPC 
         else ( upc > 9999999999)
        {
          Console.WriteLine("UPC is too big");
          Invoice.UPC
             else if()
              Console.WriteLine"UPC is {0}",upc);
        }
    
    }
    the reason im asking for help is if i dont pass this class i get kicked out of college so help would be appreciated im not very good at codeing but i want to learn

  2. #2
    E. Body
    Join Date
    Jun 2006
    Posts
    2,181
    BG Level
    7
    FFXIV Character
    Bro Teampill
    FFXIV Server
    Gilgamesh
    FFXI Server
    Ifrit

    A) I hate magic numbers.
    2) Your spelling isn't going to win you any degrees either.
    iii. No offense, you need to fail that class. Passing it by any of us telling you how to fix your code equates to you learning nothing.

  3. #3
    Hydra
    Join Date
    Apr 2006
    Posts
    105
    BG Level
    3

    i didn't ask for someone to explain the whole program to me, i just asked for a small chunk of data because i am having trouble figuring it out. i didn't ask you to correct my spelling but thanks for that. Last but not least i didn't ask for someone to come and troll my topic, so if you don't have anything to add to the topic then stay out please.

  4. #4
    E. Body
    Join Date
    Jun 2006
    Posts
    2,181
    BG Level
    7
    FFXIV Character
    Bro Teampill
    FFXIV Server
    Gilgamesh
    FFXI Server
    Ifrit

    Asking for help on some incredibly easy code when you're supposed to be a college student whose continued enrollment hinges on said incredibly easy code suggests that you shouldn't be allowed to pass that class. As a career programmer, the last thing I want is for someone like you to become my peer, because then I'll be the one having to mop up messes that people like you create. This isn't a personal attack, it's just the way things are. Either learn how to code, or take a different course. (Or alternatively, stick with your programming class and flunk out.)

  5. #5
    Hydra
    Join Date
    Apr 2006
    Posts
    105
    BG Level
    3

    Listen i don't want to start anything with you because i have do not know you, but this is the only trouble i am having with the program and i am having a lot of trouble getting answers because it is the weekend and none of the teachers are in their offices.

    This is my first computer programming class and it is very difficult for me so if you would kindly lay off the hate horn i would appreciate it, because not everyone learns as fast as some others and i am trying my best to do it.

    So please i ask you kindly if your going to tell me to flunk the course and give up hope then don't respond because i refuse to give up on it. i chose this course and i will complete it without failing, and asking for help is allowed so i am doing so here.

  6. #6
    THOU THOU THOU THOU THOU THOU THOU THOU
    Avatar of Fury.

    Join Date
    Jan 2006
    Posts
    5,584
    BG Level
    8
    FFXIV Character
    Shiroe Blackrose
    FFXIV Server
    Diabolos
    FFXI Server
    Carbuncle

    My first comment/suggestion would be to go back and learn how to write an if/else statement because holy balls, that is wrong.

  7. #7
    Hydra
    Join Date
    Apr 2006
    Posts
    105
    BG Level
    3

    ok, i wasn't sure if i was looking to deep into the question like i sometimes do instead of thinking simple. i thought of a if/else statement and i couldn't find my book. thanks for suggestions at least i know its way off heh.

  8. #8
    E. Body
    Join Date
    Jun 2006
    Posts
    2,181
    BG Level
    7
    FFXIV Character
    Bro Teampill
    FFXIV Server
    Gilgamesh
    FFXI Server
    Ifrit

    Code:
    private const ulong minUPC = 1111111111;
    private const ulong maxUPC = 9999999999;
    private ulong upc = 0;
    
    do
    {
        upc = Invoice.GetUPC();
        if (upc < minUPC || upc > maxUPC)
        {
            Console.WriteLine("UPC out of bounds.");
        }
        else
        {
            break;
        }
    }
    while (true);
    That's the way it should look, imo. I have no idea how your Invoice class is implemented, but requiring some sort of input from a user should be a method, not a property (the way you had it typed out looks like a property.) I doubt this is going to teach you anything, but if it does, great...

  9. #9
    Hydra
    Join Date
    Apr 2006
    Posts
    105
    BG Level
    3

    yeah i was going for a method, i messed up i see now, and yes that does help and teach me :D i appreciate it much. thank you.

  10. #10
    Ridill
    Join Date
    May 2005
    Posts
    13,568
    BG Level
    9

    taking bets on whether his next assigment shows up here too.

  11. #11
    D. Ring
    Join Date
    Jun 2006
    Posts
    4,855
    BG Level
    7
    FFXI Server
    Ragnarok
    WoW Realm
    Nazjatar

    whats the odds/payouts?

  12. #12
    Banned.

    Join Date
    Oct 2006
    Posts
    10,115
    BG Level
    9

    Quote Originally Posted by izembo
    whats the odds/payouts?

    So... i have this php code...




    the whistle emoticon code is broken btw