0

Area of a circle c# project 1

Hey guys. Doing the first code project is frustrating me. I know I need to make radius = Convert.ToDouble(Console.ReadLine), but I don't know what math is needed to solve it. Pi squared , is that * 2? Heck. When Google gives how to find the area of a circle i got snagged so hoping for some assistance. Thanks

24th Jun 2022, 12:31 AM
Ryan Rockwell
Ryan Rockwell - avatar
5 odpowiedzi
+ 2
Ryan Rockwell Good attempt. I made a little mistake when I told you **2 = squared, that was for Python -> my bad! Here is your code tweaked. I adjusted your "d" parameter as it was incorrect and not being used, so commented out of the program. Also fixed your "a" parameter using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { const double pi = 3.14; double r = Convert.ToDouble(Console.ReadLine()); // double d = 2*pi*r; double a = pi*r*r; Console.WriteLine(a); } } }
25th Jun 2022, 1:48 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 3
Ryan Rockwell Diameter = 2 * Pi * R Area Circle = Pi * R **2 **2 -> squared Pi = 3.14
24th Jun 2022, 2:31 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
:(((( ty
24th Jun 2022, 7:50 AM
Ryan Rockwell
Ryan Rockwell - avatar
+ 1
So, I tried applying this in what I thought you were explaining but im having a rough time. Would appreciate any assistance in understanding my misunderstanding hahahaha. Sorry. Hate getting stuck like this and having to ask for help when I know its gonna be something I should know using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { const double pi = 3.14; double r = Convert.ToDouble(Console.ReadLine()); double d = r*pi*r; double a = pi*r**2; Console.WriteLine(a); } } }
25th Jun 2022, 12:41 AM
Ryan Rockwell
Ryan Rockwell - avatar
+ 1
Oh man. Ty so much. Seriously appreciate your help. Trying to move forward felt difficult like I didnt need to keep going if I could do that part lol.
25th Jun 2022, 2:04 AM
Ryan Rockwell
Ryan Rockwell - avatar