Hi,
I have created program and got correct answer for the operation + - / and * but my program is not giving me result for area of the circle
Could you please correct my program and tell me what is wrong
Thanks a lot
P.S. I am beginner
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
MartaPosted Sep 16, 2012, 3:21 PM
VulpesPosted Sep 16, 2012, 2:57 PM
double area = ConsoleApplication4.Calculator.AreaOfCircle(radius);
If you change the former to AreaOfCircle, then it will compile and work fine.
MartaPosted Sep 16, 2012, 2:38 PM
VulpesPosted Sep 16, 2012, 2:19 PM
Repost the code if you like - just copy and paste it into the box - no need to upload a .rar file.
MartaPosted Sep 16, 2012, 10:58 AM
VulpesPosted Sep 16, 2012, 10:33 AM
'AreaOfCircle' was just my suggestion.
MartaPosted Sep 16, 2012, 10:30 AM
It should be simple because num1 should be radius of the circle ....and this num 1 I need to use to calculate before but..
VulpesPosted Sep 16, 2012, 9:53 AM
But you should be asking the user for the radius and then outputting the area of the circle:
MartaPosted Sep 16, 2012, 3:28 AM
And now I do not get result of previous operations...
Before coccrection nafter debbuging program gave me result:
Operand 1: ....I can add first number
Operand 2: ...second nimber
Operator: ..for example +
and then I got result. Now they gave me:
Operand: i can type in number
Operand 2: second number
Operator: can add + - etc.
But in stead of calculation, I got
Area of the circle:
MartaPosted Sep 16, 2012, 3:27 AM
VulpesPosted Sep 15, 2012, 6:45 PM
This should be OK:
MartaPosted Sep 15, 2012, 3:32 AM
VulpesPosted Sep 14, 2012, 6:51 PM
double area = Math.PI * radius * radius;
Notice that it's more efficient to multiply the radius by itself than to use the Math.Pow method.