0

# C# Area of Circle

I am still a beginner and learned a few basics on variables, so I have managed to get the 1st part of the problem but cant find a way to solve all of them at once. Your help will be highly appreciated. xx

8 Answers

+ 5

Please save your attempt on SL Playground and link here.

+ 2

Your code should work for each input. You have to read the radius and calculate with it. Plesse try that.

+ 2

Lawrance Tosa
You need to know what this line do.
Convert.ToDouble(t);
You didn't take input. Don't write Hard Code logic.

0

https://code.sololearn.com/c8a22A11a199/#cs hope you understand what I did there

0

I declared variable t and gave it a value of pi * radius, isn't that the input?

0

I used the Convert.ToDouble because the instructions said convert the inputted value to double

- 1

Lawrance Tosa review your previous lesson(s) wich should have teached how to get input from user, as a double value in 'radius' variable...
next, use it to compute area by doing PI*radius*radius (squared radius), but avoid using PI as self defined constant number with only 2 digits precision after dot, but rather use the builtin constant available in Math module ;)

- 1

Is it also possible to write the code with ()² or ^2?
I already know the writing goes like ... (radius * radius) but i am wondering if there is a more easy way of coding it ...
Thx ;)