Click here to Skip to main content
14,825,830 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I implemented an interface
C#
interface IMathOperationDemo
{
    string getMinimum(decimal Alpha);
    string getMaximum (decimal Beta);
    string getMesorja (decimal Alpha,decimal Beta);
    string getMesatarja (decimal Alpha,decimal Beta);
    string getModa (decimal Alpha,decimal Beta);
    string getVarianca(decimal Alpha,decimal Beta);

   }


and wrote a class
C#
class Normale : IMathOperationDemo
 {
     decimal Alpha;
     decimal Beta;
     decimal mesatarja;
     decimal moda;
     decimal mesorja;
     decimal varianca;
     public string getMinimum();
     public string getMaximum();
     public string GetMesatarja(decimal Alpha,decimal Beta)
     {
         mesatarja = (Alpha + Beta) / 2;
         return mesatarja.ToString;
                 }
     public string GetMesorja(decimal Alpha, decimal Beta)
     {
         mesorja = (Alpha + Beta) / 2;
         return mesorjaToString;
     }
     public string GetModa(decimal Alpha, decimal Beta)
     {
         moda = (Alpha + Beta) / 2;
         return moda.ToString;
     }
     public decimal GetVarianca(decimal Alpha,decimal Beta)
     {
         varianca = ((Beta-Alpha+1)*(Beta-Alpha+1)-1) / 12;
         return varianca.ToString;
     }

and want to publish this values to some textboxes in the mainform.
Anyway getting error message
must declare a body because it is not marked abstract, extern, or partial

Can help pls?

Regards
Posted

I think the error message is pretty self-explaining. You have to implement the getMinimum() and getMaximum() functions.
   
Comments
   
Correct, my 5, but why nobody looks on what's implemented? It's completely useless.
Please look at my answer where I explain it.
--SA
When we implement interface then we have to implement all the methods in it. Hence while implementing IMathOperationDemo interface you have to implement all the methods, but you are missing the implementation of
C#
string getMinimum(decimal Alpha);
    string getMaximum (decimal Beta);
in your class Normale.

got it..

You can refer the following link for more help:

http://www.csharp-station.com/Tutorials/Lesson13.aspx[^]
   
Comments
   
Correct, my 5, but why nobody looks on what's implemented? It's completely useless.
Please look at my answer where I explain it.
--SA
Please look at my answer to your previous question: Cannot convert to string[^].

Whole thing is useless!

—SA
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900