using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
public class circle
{
public double r;
public void getdata()
{
Console.Write("Enter radius");
r = double.Parse(Console.ReadLine());
}
}
interface area
{
void circarea();
}
public class main : circle, area
{
public double pie = 3.14;
public double area1;
public void circarea()
{
area1 = pie * r * r;
}
public void showdata()
{
Console.Write("The area of the circle is:" + area1);
}
}
static void Main(string [] args){
main m = new main();
m.getdata();
m.circarea();
m.showdata();
Console.ReadKey();
}
}
}
/*Do leave a comment if you find this useful*/
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
public class circle
{
public double r;
public void getdata()
{
Console.Write("Enter radius");
r = double.Parse(Console.ReadLine());
}
}
interface area
{
void circarea();
}
public class main : circle, area
{
public double pie = 3.14;
public double area1;
public void circarea()
{
area1 = pie * r * r;
}
public void showdata()
{
Console.Write("The area of the circle is:" + area1);
}
}
static void Main(string [] args){
main m = new main();
m.getdata();
m.circarea();
m.showdata();
Console.ReadKey();
}
}
}
/*Do leave a comment if you find this useful*/
No comments:
Post a Comment