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;
- namespace ConsoleApplication1
- {
- class Tacka
- {
- private double _x;
- private double _y;
- public void SetX(double x)
- {
- this._x = x;
- }
- public double GetX()
- {
- return this._x;
- }
- //property za pristup polju _y
- public double Y
- {
- get { return _y; }
- set { this._y = value; }
- }
- public Tacka () {}
- public Tacka(double x,double y)
- {
- this.SetX(x);//poziv metode za setovanje vrednosti
- this.Y = y;//poziv propertija
- }
- public string Prikazi()
- {
- string pom = string.Format("{0},{1}", this.GetX(),this.Y);
- return pom;
- }
- public Tacka Centar
- {
- get { return _centar; }
- set
- {
- this._centar = value;
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- double x,y;
- x = Convert.ToDouble(Console.ReadLine());
- y = Convert.ToDouble(Console.ReadLine());
- Tacka t = new Tacka(x, y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement