|
-
Dec 15th, 2007, 02:13 PM
#1
Thread Starter
New Member
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
-
Dec 15th, 2007, 03:49 PM
#2
Hyperactive Member
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.
-
Dec 15th, 2007, 04:17 PM
#3
Thread Starter
New Member
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...
-
Dec 15th, 2007, 04:20 PM
#4
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.
-
Dec 15th, 2007, 05:29 PM
#5
Hyperactive Member
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
-
Dec 15th, 2007, 09:26 PM
#6
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?".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|