Mr. Biscan Posted February 24, 2010 Posted February 24, 2010 Right I need to convert imperial to metric or whatever, and I am trying to multiply the figure typed in by the user to get the result and display it. However I can't seem to convert it. I have tried creating a variable saying int (killo*2.2406) = impcon;, however that comes up with an error, I have also tried writing the multiplication within a convert to string function. Any advice would be greatly appreciated. string choice; int killo; double gram; int stone; double pound; int impcon; int metcon; Console.WriteLine("To convert to metric, please type 'metric' to convert to imperial, please write 'imperial'"); choice = Console.ReadLine(); Console.WriteLine("You have selected convert to {0}", choice); if (choice == "metric") { Console.WriteLine("Please enter killograms"); killo = int.Parse(Console.ReadLine()); Console.WriteLine("Please enter grams"); gram = double.Parse(Console.ReadLine()); Console.WriteLine("Your weight is {0} Killograms and {1} Grams", killo, gram); impcon = int.TryParse(Convert.ToString(killo.Equals * 2.206)); Console.WriteLine("{0}", impcon); //Console.WriteLine("Your imperial weight is {0} Stone and (1)",
drdooom Posted February 24, 2010 Posted February 24, 2010 This post is not viewable to guests. You can sign in to your account at the login page here If you do not have an account then you can register here
Nathan Explosion Posted February 24, 2010 Posted February 24, 2010 This post is not viewable to guests. You can sign in to your account at the login page here If you do not have an account then you can register here
dorgie Posted February 24, 2010 Posted February 24, 2010 This post is not viewable to guests. You can sign in to your account at the login page here If you do not have an account then you can register here
Mr. Biscan Posted February 24, 2010 Author Posted February 24, 2010 This post is not viewable to guests. You can sign in to your account at the login page here If you do not have an account then you can register here
Nathan Explosion Posted February 24, 2010 Posted February 24, 2010 (edited) This post is not viewable to guests. You can sign in to your account at the login page here If you do not have an account then you can register here Edited February 24, 2010 by Nathan Explosion
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now