Answer to Question #326615 in C# for Mandeep

Question #326615

3.“OptionA” Method 

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. 

4. “PoundsToKilograms” Method 

Create a method called “PoundsToKilograms” 

  • Name: PoundsToKilograms 
  • Parameter: A double representing the pounds 
  • Returns: A double representing the kilograms converted from pounds parameter 
  • Displays: Nothing 
  • Task: Calculates the conversion from pounds to kilograms. The converted kilogram is the returned value from the method. 
1
Expert's answer
2022-04-10T06:27:19-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