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;

///

/// This program will convert Inches to other length values using methods. /// namespace Lesson_4_Program { //Name class class InchConversion {

//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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!