Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- public class Circle
- {
- double x;
- double y;
- double R;
- string color;
- public Circle(double a, double b, double c, string d)
- {
- x = a;
- y = b;
- R = c;
- color = d;
- }
- public double Area()
- {
- return 2 * Math.PI * R;
- }
- public void Move(double a, double b)
- {
- x = a;
- y = b;
- }
- public void Printinfo()
- {
- Console.WriteLine("x = " + x + "\ny = " + y + "\nR = " + R);
- }
- }
- class Program
- {
- void Main()
- {
- double a, b, c;
- string d;
- Circle[] data = new Circle[5];
- for(int i = 0; i < 2; i++)
- {
- Console.Write("x = ");
- a = Convert.ToDouble(Console.Read());
- Console.Write("y = ");
- b = Convert.ToDouble(Console.Read());
- Console.Write("R = ");
- c = Convert.ToDouble(Console.Read());
- Console.Write("color = ");
- d = Convert.ToString(Console.Read());
- data[i] = new Circle(a, b, c, d);
- }
- Print(data);
- }
- void Print(Circle[] data)
- {
- foreach (Circle fd in data)
- {
- fd.Printinfo();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement