Answer to Question #296863 in C# for chi

Question #296863

Topic: Function

Write a function-­‐oriented program that converts the input indeed into its equivalent centimeters. One inch is equal to 2.54 cms. Display the converted centimeters value.

note: you can choose any looping statement if needed.


1
Expert's answer
2022-02-12T08:06:56-0500


using System;
using System.Collections.Generic;
using System.Globalization;


namespace App
{
    class Program
    {
        static double convertInchCentimeters(double inch)
        {
            return 2.54 * inch;
        }
        static void Main(string[] args)
        {
            Console.Write("Enter inch: ");
            double radius = double.Parse(Console.ReadLine());
            Console.WriteLine("Centimeters : {0}", convertInchCentimeters(radius));
            Console.ReadLine();
        }
    }
}

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