Question: I am having trouble getting my Methods to work in C#. I know it is something simple I am missing. //Start Code using System; using
I am having trouble getting my Methods to work in C#. I know it is something simple I am missing.
//Start Code
using System; using static System.Console;
///
//Declare constants double feetInches = 12; double yardInches = 36; double mileInches = 63360;
//Declare inout inches double inputInches = 126696;
//Declare Variables double convFeet; double convYards; double convMiles;
//Start program static void Main(string[] args) {
// store the Feet conversion in the variable returnFeet
//Convert Lengths
//Write text to console window
//Name and Class WriteLine("Wayne Dancer"); WriteLine("CIS162AD"); WriteLine("Class# 28863"); WriteLine(); WriteLine();
//Display results
double convFeet = DoConvFeet(feetInches, inputInches); WriteLine("126,696 inches in Feet= " + "{0:0.00}", convFeet); WriteLine();
double convYard = DoConvYard(yardInches, inputInches); WriteLine("126,696 inches in Yards= " + "{0:0.00}", convYards); WriteLine();
double convMile = DoConvMile(yardInches, inputInches); WriteLine("126,696 inches in Miles= " + "{0:0.00}", convMiles); WriteLine();
//keep application from closing ReadKey(); Console.ReadLine();
}
static double DoConvFeet(double feetInches, double inputInches) { double convFeet; return convFeet = (inputInches / feetInches);
} static double DoConvYard(double yardInches, double inputInches) { double convYard; return convYard = (inputInches / yardInches); } static double DoConvMile(double mileInches, double inputInches) { double convMile; return convMile = (inputInches / mileInches);
}
} }
//End Code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
