using System;
class TheProgram
{
static Cylinder Initialize()
{
Cylinder CylinderType = new Cylinder(45.32, 87.43);
return CylinderType;
}
static void ShowResults(Cylinder Volume)
{
Console.WriteLine("Enter Raidius: ");
Volume.Radius = Console.Read();
Console.WriteLine("Enter Height: "); // Debugger is skipping this
Volume.Height = Console.Read(); // No display
Console.WriteLine("Radius: {0}", Volume.Radius, "Height: {0}", Volume.Height);
}
static int Main()
{
Cylinder CylinderInit = Initialize();
ShowResults(CylinderInit);
Console.ReadLine();
return 0;
}
}
using System;
class Cylinder
{
private double RadianValue = 0;
private double HeightValue = 0;
public Cylinder(double Radius, double Height)
{
this.HeightValue = Height;
this.RadianValue = Radius;
}
public double Radius
{
get { return RadianValue; }
set { RadianValue = value; }
}
public double Height
{
get { return HeightValue; }
set { HeightValue = value; }
}
}
And another thing, How do i get the console window to stay up without using another Console.Read() type function?

New Topic/Question
Reply




MultiQuote





|