Question
How do I add 4 more methods to this program while displaying instructions like This program will convert feet and inches into meters and centimeters?
How do I add 4 more methods to this program while displaying instructions like "This program will convert feet and inches into meters and centimeters"? using System; using static system.Console; namespace Methods public class Methods { public static void Main() { string userInput; int feetVal, inchVal; int totalInches; double totalCms; int heightMeter, heightCm; Console.Write("Enter height (feet)"); userInput = Console.ReadLine(); /* Convert to integer type */ feetVal = Convert.ToInt32(userInput); Console.Write("Enter height (inches) "); userInput = Console.ReadLine(); inchVal = Convert.ToInt32(userInput); // once feet has 12 inches totalInches = feetVal * 12 + inchVal; // lets convert the inches to centimeters - once inch roughly is equal to 2.54 centimeters totalCms = totalInches * 2.54; heightMeter = (int)totalCms / 100; heightCm = (int)totalCms % 100; Console.WriteLine("Input height in (feet and inches) {0} feet {1} inches", feetVal, inchVal); Console.WriteLine("Input height int (meter and cms) {0} meter {1} cm", heightMeter, heightCm); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started