Results 1 to 6 of 6

Thread: A layman need your help @^@

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    2

    Smile A layman need your help @^@

    Hi, Pros. I am a rookie on programming and really need some help to solve a few problem. Thank you in advance.

    1)
    int k;
    class Point
    { public int x;
    public int y;
    }
    Point [] coord = new Point[9];
    k=0;
    for (int i=1;i<=3;i++)
    { for (int j=1;j<=3;j++)
    { coord [k]=new Point();
    coord [k].x=i;
    coord [k].y=j;
    k++
    }
    MessageBox.Show("Value is[" + coord[4].x +"," +coord[4].y+"]")

    Which is right shown in the message box?
    a. Value is [1,3]
    b. Value is [2,2]
    c. Value is [3,1]
    d. Value is [1,1]
    e.None of the above

    2)
    double x, z;
    x=5.10;
    z=f(x);
    and f(x) is a given function that returns a double.

    How to test to determine whether z==1.0,
    a. Math.Abs(z-1.0)<=o.0000001;
    b. z==1.0;
    c. both

  2. #2
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382

    Re: A layman need your help @^@

    Lemme guess, this is your assignment...
    1.) Im sure your doing a course with a lecture on programming, ill leave this to you :P Tip try running it, if you can!

    2.) Second one is harder, im going for b. As Math.Abs returns an absolute value (always positive) , f(x) could return a negative and i think it has o on it not 0.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    2

    Re: A layman need your help @^@

    Thank U ++ for your timely reply.
    To be honest, these are two problems on the sample exam of my programming course.
    I GOT the answer to 1st one is b. Is it right?!

    Thank u again. HaHa-Xmas...

  4. #4
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: A layman need your help @^@

    cccjay, we're more than happy to help you with questions but we're not going to just do your work for you (good job there helping to give him an answer, Greyskull).

    If you want us to help you, then attempt to work them out yourself and ask us quesitons regarding your work.

    Don't just take the lazy route and post your questions and ask us to answer them. You'll never learn that way. If you really want that, then go to RentACoder and pay someone to do your homework if you want to be that low.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  5. #5
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382

    Re: A layman need your help @^@

    lol kasracer ^_^ You're right, an attempt should be done first...

    To ccjay Q1 is not b...look into the code more carefully

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: A layman need your help @^@

    An appropriate question in this regard would be like "here is the question, here is what I think the answer is and why, can you point out any issues with my logic?".
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width