C# School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a C# Expert!

Join 309,262 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 2,474 people online right now. Registration is fast and FREE... Join Now!




First C# application and having problems

 

First C# application and having problems

phillover80

28 Jun, 2009 - 05:08 PM
Post #1

New D.I.C Head
*

Joined: 28 Jun, 2009
Posts: 9

I'm new to C# programming language. This is my first assignment that is supposed to convert a temperature from Fahrenheit to Celsius. It should use three different methods; one for input, one for the conversion and one to display the results.
I've been working on this for a couple days and have taken out some things, added some things and switched some things around but I keep getting different errors. Can anyone take a look and tell me what I am doing wrong? Your help is very much appreciated. I though this was fairly simple at first but it's just not working for me.

CODE
using System;

namespace TemperatureConverter
{
    class FahrenheitConverter
    {
        
        //User Input
        static void Main()
        {
            double cTemp;
            double fTemp;

            InputValues();
            ConvertToCelsius(fTemp);
            DisplayResults(cTemp);
            Console.Read();        
        }
        public static void InputValues()
        {
            string inputTemp;

            Console.Write("Please enter the Fahrenheit temperature: ");
            inputTemp = Console.ReadLine();
            
                
        }
        //To convert from Fahrenheit to celsius
        public static double ConvertToCelsius(double fTemp)
        {
            return (fTemp - 32) * 5/9;
        }
        //Display the results
        public static void DisplayResults(double cTemp)
        {
            Console.Write("{0} degrees Fahrenheit is the same as ");
            Console.WriteLine("{1} degrees Celsius");
            

        }
    }
}


User is offlineProfile CardPM
+Quote Post



Fast ReplyReply to this topicStart new topic

Time is now: 11/26/09 10:12AM

Live C# Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month