Click here to Skip to main content
16,009,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: sorting information from several threads - is my algorithm correct? Pin
John Torjo18-Nov-15 10:38
professionalJohn Torjo18-Nov-15 10:38 
QuestionNeed help with creating of program Pin
F1nger17-Nov-15 5:01
F1nger17-Nov-15 5:01 
Hi, guy's.
I get some task from teacher so i really need to help.

Task:
Develop and implement functional classes.
Class of points. The base class (three-dimensional point in the plane with integer coordinates).
Methods: calculate the distance between points; adding the coordinates of two points; input - output on the screen; test the convergence of two points.
The original class: the pixels on the screen (points that have color).

Thank's.

That's what i already done:

C#
public  interface ITestPoint
    {
         double PointDistance();
         void OutPoint();
         void SetPoint(double x,double y,double _x,double _y);
    }
    class Point :ITestPoint
    {
        public double x1, x2, y1, y2;

        public double PointDistance()
        {
            return Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2));
        }
        public void OutPoint()
        {
            Console.WriteLine("Point One({0},{1}); Point Two({2},{3})",x1,y1,x2,y2);
        }
       public void SetPoint(double x,double y,double _x,double _y)
        {
            x1 = x;
            y1 = y;
            x2 = _x;
            y2 = _y;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Point p = new Point();

            p.SetPoint(2,3,5,8);
            p.OutPoint();
            Console.WriteLine(p.PointDistance());
            Console.ReadLine();
        }
    }

AnswerRe: Need help with creating of program Pin
OriginalGriff17-Nov-15 5:12
mveOriginalGriff17-Nov-15 5:12 
GeneralRe: Need help with creating of program Pin
F1nger17-Nov-15 5:16
F1nger17-Nov-15 5:16 
GeneralRe: Need help with creating of program Pin
OriginalGriff17-Nov-15 5:20
mveOriginalGriff17-Nov-15 5:20 
GeneralRe: Need help with creating of program Pin
F1nger17-Nov-15 5:20
F1nger17-Nov-15 5:20 
GeneralRe: Need help with creating of program Pin
OriginalGriff17-Nov-15 5:26
mveOriginalGriff17-Nov-15 5:26 
AnswerRe: Need help with creating of program Pin
Pete O'Hanlon17-Nov-15 5:14
mvePete O'Hanlon17-Nov-15 5:14 
GeneralRe: Need help with creating of program Pin
F1nger17-Nov-15 5:17
F1nger17-Nov-15 5:17 
GeneralRe: Need help with creating of program Pin
Dave Kreskowiak17-Nov-15 6:40
mveDave Kreskowiak17-Nov-15 6:40 
GeneralMaking Application a Trial Version Pin
Member 1202173416-Nov-15 22:29
Member 1202173416-Nov-15 22:29 
GeneralRe: Making Application a Trial Version Pin
Richard MacCutchan16-Nov-15 22:40
mveRichard MacCutchan16-Nov-15 22:40 
GeneralRe: Making Application a Trial Version Pin
Pete O'Hanlon16-Nov-15 23:07
mvePete O'Hanlon16-Nov-15 23:07 
GeneralRe: Making Application a Trial Version Pin
Member 1202173410-Dec-15 22:27
Member 1202173410-Dec-15 22:27 
Questioncall web API in c# Pin
Member 1212120116-Nov-15 18:15
Member 1212120116-Nov-15 18:15 
QuestionRe: call web API in c# Pin
PANKAJMAURYA16-Nov-15 18:31
professionalPANKAJMAURYA16-Nov-15 18:31 
AnswerRe: call web API in c# Pin
OriginalGriff16-Nov-15 20:20
mveOriginalGriff16-Nov-15 20:20 
AnswerRe: call web API in c# Pin
Pete O'Hanlon16-Nov-15 21:22
mvePete O'Hanlon16-Nov-15 21:22 
QuestionHow to improve Parallel.For loading speed? Pin
smallkubi16-Nov-15 13:46
smallkubi16-Nov-15 13:46 
AnswerRe: How to improve Parallel.For loading speed? Pin
Richard Deeming17-Nov-15 4:48
mveRichard Deeming17-Nov-15 4:48 
GeneralRe: How to improve Parallel.For loading speed? Pin
smallkubi17-Nov-15 13:43
smallkubi17-Nov-15 13:43 
GeneralRe: How to improve Parallel.For loading speed? Pin
Simon_Whale18-Nov-15 1:26
Simon_Whale18-Nov-15 1:26 
Questionbest explanation of using C# 'virtual, or 'abstract methods ... for beginners in the language Pin
BillWoodruff16-Nov-15 3:58
professionalBillWoodruff16-Nov-15 3:58 
AnswerRe: best explanation of creating a C# class as 'virtual, or 'abstract ... for beginners in the language Pin
OriginalGriff16-Nov-15 4:04
mveOriginalGriff16-Nov-15 4:04 
GeneralRe: best explanation of creating a C# class as 'virtual, or 'abstract ... for beginners in the language Pin
BillWoodruff16-Nov-15 4:20
professionalBillWoodruff16-Nov-15 4:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.