Answer to Question #318972 in C# for roshan

Question #318972

implement a C# method

TemperatureConverter(

double

tempInCelsius

)

which

accepts the temperature in Celsius as input parameter and returns the temperature in

Fahrenheit

as the output value.


Note:

T

(°F)

=

T

(°C)

× 1.8 + 32


Sample Input

Expected Output


tempInCelsius = 32

89.6




1
Expert's answer
2022-03-27T09:59:35-0400
using System;

namespace Temp_conv
{
    class Program
    {
        public static double TemperatureConverter(double tempInCelsius)
        {
        double Fahrenheit = tempInCelsius * 1.8 + 32;
           
        return (Fahrenheit);
        }

        public static void Main(string[] args)
        {
            double Celsius;
            Console.Write("tempInCelsius = ");
            Celsius = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Temperature in Fahrenheit = {0}", TemperatureConverter(Celsius));
      
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS