my first class - getting an error
- From: vinnie <centro.gamma@xxxxxxxxx>
- Date: Mon, 10 Sep 2007 16:36:21 -0700
I did my first project with the classes, but i get an error that i
don't understand, and so don't know how to correct it.
The error is :
"Error 1 'mixed_class.Program' does not contain a definition for
'Calculus' and no extension method 'Calculus' accepting a first
argument of type 'mixed_class.Program' could be found (are you missing
a using directive or an assembly reference?) C:\Documents and Settings
\Robert\Desktop\prova VS8\mixed_class\Program.cs 20 20 mixed_class"
This is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace mixed_class
{
public class Program
{
public static void Main(string[] args)
{
double c = 0;
Console.WriteLine(" Program for calculating the sum");
Console.WriteLine();
Console.WriteLine(" Insert first value:...");
double a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine(" Insert the second value:... ");
double b = Convert.ToDouble(Console.ReadLine());
Program So = new Program();
c = So.Calculus(3, 4);
Console.WriteLine(" The sum is: {0}", c);
Console.ReadLine();
}
}
public class summing
{
public double Calculus(double a, double b, out double c)
{
c = a + b;
return c;
}
}
}
.
- Follow-Ups:
- Re: my first class - getting an error
- From: Registered User
- Re: my first class - getting an error
- From: Peter Duniho
- Re: my first class - getting an error
- Prev by Date: Re: Threading Question
- Next by Date: need help with string format
- Previous by thread: increment difference
- Next by thread: Re: my first class - getting an error
- Index(es):
Relevant Pages
|