create a console-based application named ConvertInchesToCm whose Main() method prompts a user for a number of inches, passes the value to a method that converts the value to centimeters, and then returns the value to the main() method where it is displayed. An inch is 2.54 centimeters.
b. create a GUI application named ConvertInchesToCmGUI that uses a method. The program convets inches to centimeters when the user clicks a button.
Loading
Wim SturkenboomPosted Oct 9, 2014, 2:20 AM
pad padPosted Oct 9, 2014, 2:12 AM
I am trying to do in GUI with same code but its not working. Please can any one help to write in GUI.
Posted Oct 7, 2014, 3:16 PM
class Program
{
static void Main(string[] args)
{
Console.Write("Input a inch value ");
double x = double.Parse(Console.ReadLine());
double y = x * 2.54;
Console.WriteLine(x + " inch = " + y + " cm");
Console.ReadKey();
}
}
Hemant SrivastavaPosted Oct 7, 2014, 1:42 PM
It's very simple program you should try it first before asking
We generally learn only when we try :)
Try:
http://stackoverflow.com/questions/8443198/c-sharp-converts-inches-to-cents
pad padPosted Oct 7, 2014, 1:09 PM
Wim SturkenboomPosted Oct 7, 2014, 2:08 AM