Assingment: Write an application that prompts the user for the radius of a circle and use method CircleArea to calculate the area of the circle. Turn in your source code on uLearn
My Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Radius{
public class Circle // declaration of class - I want to find area of circle
{
static void Main(string[] args)
{
double r;
double CircleArea;
double pi = 3.14;
Console.WriteLine("Would you like to know the area of a circle?");//intro message
Console.WriteLine("Please enter the radius."); //promt end-user for number
Console.ReadLine();//reads input from end-user
r = Convert.ToDouble(Console.ReadLine()); //assings number from end-user to variable r
CircleArea = (3.14 * r * r); //this is the equation for the area of a circle
Console.WriteLine("The area of the circle is" + CircleArea);
}
}
}



Back to top







