public static void Main(string[] args)
Console.WriteLine("Methods: Slope");
Console.WriteLine("--------");
Console.WriteLine("This program wil calculate the Y value when the slope (m), x intercept (x) and the y (b) intercept are provided. Y = mx + b");
Console.WriteLine("Please provide the slope of the line (m): ");
var slopeValue = double.Parse(Console.ReadLine());
Console.WriteLine("Please provide the x intercept (x): ");
var xIntercept = double.Parse(Console.ReadLine());
Console.WriteLine("Please provide the y intercept (b): ");
var yIntercept = double.Parse(Console.ReadLine());
double yValue = LineValueForY(slopeValue, xIntercept, yIntercept);
Console.WriteLine("The Y Value is: " + yValue.ToString() + ".");
Console.WriteLine("Program has completed. Press any key to exit.");
Console.WriteLine("---------------------------------------------------");
private static double LineValueForY(double slopeValue, double xIntercept, double yIntercept)
return (slopeValue * xIntercept) + yIntercept;