S
Schizoid Man
I have two classes. The first one called Program contains the Main() method.
This class ideally should be able to call a method called normDensity
from another class NormalDistribution code attached below the first class.
I instantiate the NormalDistribution class as:
NormalDistribution normal_dist = new NormalDistribution();
So technically, I should be able to call the method
normal_dist.normDensity from Main(). However, I cannot see this method.
Any ideas?
Thanks in advance.
Schiz
using System;
using System.Collections.Generic;
using System.Text;
namespace Distributions
{
class Program
{
static void Main(string[] args)
{
string tempNumber;
double inputNumber;
Console.Write("Enter a number: ");
tempNumber = Console.ReadLine();
inputNumber = Convert.ToDouble(tempNumber);
Console.Write("The pdf of {0} is {1}", inputNumber, MISSING
METHOD);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Distributions
{
class NormalDistribution
{
NormalDistribution normal_dist = new NormalDistribution();
const double pi = 3.1415926535897932384;
public static double normDensity(double x)
{
return Math.Exp(-0.5 * x * x) / Math.Sqrt(2 * pi);
}
}
}
This class ideally should be able to call a method called normDensity
from another class NormalDistribution code attached below the first class.
I instantiate the NormalDistribution class as:
NormalDistribution normal_dist = new NormalDistribution();
So technically, I should be able to call the method
normal_dist.normDensity from Main(). However, I cannot see this method.
Any ideas?
Thanks in advance.
Schiz
using System;
using System.Collections.Generic;
using System.Text;
namespace Distributions
{
class Program
{
static void Main(string[] args)
{
string tempNumber;
double inputNumber;
Console.Write("Enter a number: ");
tempNumber = Console.ReadLine();
inputNumber = Convert.ToDouble(tempNumber);
Console.Write("The pdf of {0} is {1}", inputNumber, MISSING
METHOD);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Distributions
{
class NormalDistribution
{
NormalDistribution normal_dist = new NormalDistribution();
const double pi = 3.1415926535897932384;
public static double normDensity(double x)
{
return Math.Exp(-0.5 * x * x) / Math.Sqrt(2 * pi);
}
}
}