Answer to Question #326613 in C# for Mandeep

Question #326613


 Create a method called “OptionA” that will print the conversion from pounds to kilograms by calling “PoundsToKilograms” method (defined in the item #4 below) starting at 200 pounds down to 50 pounds in decrements of 5. Show the result on a table in the console. 


1
Expert's answer
2022-04-10T06:27:16-0400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace C_SHARP
{
    class Program
    {
        static double PoundsToKilograms(double pounds)
        {
            return pounds * 0.454;
        }


        static void OptionA()
        {
            for (int i = 200; i >= 50; i -= 5) {
                Console.WriteLine(i.ToString() + " pounds = " + PoundsToKilograms(i).ToString() + " Kilograms");
            }
        }


        static void Main(string[] args)
        {
            OptionA();


            Console.ReadKey();
        }
    }
}

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