EDN Admin
Well-known member
I need help creating a application that converts inches to feet and vice versa, this problem comes based off of this application I had to create to convert Fahrenheit to Celsius and vice versa--below is the first application. I get the basic idea of how
to start, but Im having trouble with what I should put to start the conversion, what variable? Everything Im putting in is coming up as error.<br/>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Option Strict <span style="color:Blue; On
<span style="color:Blue; Option <span style="color:Blue; Explicit <span style="color:Blue; On
<span style="color:Blue; Module TemperatureConverter
<span style="color:Blue; Sub Main()
<span style="color:Green; declare variables
<span style="color:Blue; Dim fahrenheit, celsius <span style="color:Blue; As <span style="color:Blue; Double
<span style="color:Green; display prompt
Console.WriteLine(<span style="color:#A31515; "Please enter a Fahrenheit temperature:")
<span style="color:Green; read fahrenheit temperature & convert to data type Double
fahrenheit = Convert.ToDouble(Console.ReadLine())
<span style="color:Green; computer celsius
celsius = 5 / 9 * (fahrenheit - 32)
<span style="color:Green; round to one decimal
celsius = Math.Round(celsius, 1)
<span style="color:Green; display result
Console.WriteLine(fahrenheit & <span style="color:#A31515; " F = " & celsius & <span style="color:#A31515; " C")
<span style="color:Blue; End <span style="color:Blue; Sub
<span style="color:Blue; End <span style="color:Blue; Module
[/code]
<br/>
View the full article
to start, but Im having trouble with what I should put to start the conversion, what variable? Everything Im putting in is coming up as error.<br/>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Option Strict <span style="color:Blue; On
<span style="color:Blue; Option <span style="color:Blue; Explicit <span style="color:Blue; On
<span style="color:Blue; Module TemperatureConverter
<span style="color:Blue; Sub Main()
<span style="color:Green; declare variables
<span style="color:Blue; Dim fahrenheit, celsius <span style="color:Blue; As <span style="color:Blue; Double
<span style="color:Green; display prompt
Console.WriteLine(<span style="color:#A31515; "Please enter a Fahrenheit temperature:")
<span style="color:Green; read fahrenheit temperature & convert to data type Double
fahrenheit = Convert.ToDouble(Console.ReadLine())
<span style="color:Green; computer celsius
celsius = 5 / 9 * (fahrenheit - 32)
<span style="color:Green; round to one decimal
celsius = Math.Round(celsius, 1)
<span style="color:Green; display result
Console.WriteLine(fahrenheit & <span style="color:#A31515; " F = " & celsius & <span style="color:#A31515; " C")
<span style="color:Blue; End <span style="color:Blue; Sub
<span style="color:Blue; End <span style="color:Blue; Module
[/code]
<br/>
View the full article